DriftResponseCalc_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: DriftResponseCalc
3 // Module Type: producer
4 // File: DriftResponseCalc_module.cc
5 //
6 // Generated at Mon Nov 19 15:48:48 2012 by Ruth Toner using artmod
7 // from art v1_02_06.
8 ////////////////////////////////////////////////////////////////////////
9 
10 //C++ and C:
11 #include <cmath>
12 #include <iostream>
13 #include <fstream>
14 #include <vector>
15 #include <limits>
16 
17 //Framework:
23 #include "art_root_io/TFileService.h"
25 #include "cetlib_except/exception.h"
28 
29 //NovaSoft:
32 #include "Geometry/Geometry.h"
33 #include "NovaDAQConventions/DAQConventions.h"
34 #include "RecoBase/CellHit.h"
36 #include "Calibrator/Calibrator.h"
38 
39 // ROOT includes
40 #include "TH1F.h"
41 #include "TH2F.h"
42 
43 namespace caldp {
44  class PCHit;
45  class DriftResponse;
46 }
47 
48 
49 namespace calib {
50 
52  public:
53  explicit DriftResponseCalc(fhicl::ParameterSet const & p);
54  virtual ~DriftResponseCalc();
55 
56  void produce(art::Event & e) override;
57  void reconfigure(fhicl::ParameterSet const & p);
58  void beginJob() override;
59  void beginRun(art::Run & r) override;
60  void endRun(art::Run & r) override;
61 
62  private:
63 
64  //Function to create ID for individual plane and FEB
66 
67  //Fill map with hits:
68  void FillPeCorrHits(art::Handle<std::vector<caldp::PCHit> > &cells,
69  std::map< daqchannelmap::dchan, std::vector<double> > &mMeanPe,
70  novadaq::cnv::DetId detid);
71 
72  //Calculate mean, error on mean, number of bottom 90% hits
73  void CalculateMean(std::vector<double> &chanvector,double &fMean,double &fMeanErr,int &fNHits, double &fRMS);
74 
75  //Draw distribution for bottom 90% hits
76  void DrawMean(std::vector<double> &chanvector,TH1F *hpecorr);
77 
78  //Input string names
79  std::string fPCHitLabel ;///Label of PCHit data
80  std::string fQualXYName ;///Instance name, XY qual hits
81  std::string fQualZName ;///Instance name, Z qual hits
82  std::string fQualAvgName ;///Instance name, Avg qual hits
83  std::string fFillType ;///Method for calculating means (which quals to use)
84  bool fDrawMeans ;///Save response histograms to file, true/false?
85  int fDiBlockNum ;///DiBlock Number to use (set to 0 with fDCMNum=0 to run all)
86  int fDCMNum ;///DCM Number to use (set to 0 with fDiBlockNum=0 to run all)
87 
88  //Histograms of PE to get Truncated Mean:
89  std::map< daqchannelmap::dchan, std::vector<double> > mMeanPeXY;
90  std::map< daqchannelmap::dchan, std::vector<double> > mMeanPeZ;
91  std::map< daqchannelmap::dchan, std::vector<double> > mMeanPeAvg;
92 
93  //Time variables:
94  std::vector<double> eventTime;
95  std::uint32_t minTime ;
96  std::uint32_t maxTime ;
97 
98  //Data or MC tag
99  bool isData;
100 
101  //Output histograms for use later for debugging
102  std::map<daqchannelmap::dchan, TH1F*> srHistprint;
103  TH2F* hMeanDet;
104  TH1F *hRMS;
105  TH1F *hMeanFrac;
106  TH1F *hNHits;
107 
108  };
109 
110 DriftResponseCalc::DriftResponseCalc(fhicl::ParameterSet const & p)
111 : EDProducer(p)
112 {
113  reconfigure(p);
114 
115  //DriftResponse output produced every Run
116  produces< std::vector<caldp::DriftResponse >, art::InRun >();
117 
118 }
119 
121 {
122 }
123 
124 
126 {
127  fPCHitLabel = pset.get< std::string >("PCHitLabel"); //Label of PCHitList module
128  fQualXYName = pset.get< std::string >("QualXYName"); //Instance label, "XY" quality hits
129  fQualZName = pset.get< std::string >("QualZName"); //Instance label, "Z" quality hits
130  fQualAvgName = pset.get< std::string >("QualAvgName");//Instance label, "Avg" quality hits
131  fDrawMeans = pset.get< bool >("DrawMeans"); //Do or do not save mean histos
132  fFillType = pset.get< std::string >("FillType"); //How to calc means
133  fDiBlockNum = pset.get< int >("DiBlockNum"); //Number of DiBlock to run (if = 0, run all)
134  fDCMNum = pset.get< int >("DCMNum"); //Number of DiBlock to run (if = 0, run all)
135 
136 }
137 
138 
140  ///Returns unique ID, channel number for pixel 0 in corresponding FEB
141 
142  //Channel map service:
144 
145  //---Find and assign a unique ID number to the current FEB---//
146  //Get the DAQ channel ID for this cell/plane/det:
147  daqchannelmap::lchan logchannel = cmap->Map()->encodeLChan(det, plane, cell);
148  daqchannelmap::dchan daqchannel = cmap->Map()->encodeDChan(logchannel);
149  //Get the DiBlock number for this DAQ channel:
150  daqchannelmap::diblock_t diblock = cmap->Map()->getDiBlock(daqchannel);
151  //Get the DMC for this DAQ channel:
152  daqchannelmap::dcm_id_t dcm = cmap->Map()->getDCM(daqchannel);
153  //Get the FEB position for this DAQ channel:
154  daqchannelmap::feb_t dcmlink = cmap->Map()->getFEB(daqchannel);
155 
156  //Pixel 0 is the unique channel ID:
157  daqchannelmap::dchan chanid = cmap->Map()->encodeDChan(det, diblock, dcm, dcmlink, 0);
158 
159  //Return unique ID for FEB:
160  return chanid;
161 
162 }
163 
164 void DriftResponseCalc::FillPeCorrHits(art::Handle<std::vector<caldp::PCHit> > &cells, std::map< daqchannelmap::dchan, std::vector<double> > &mMeanPe, novadaq::cnv::DetId detid){
165  ///Adds PECorr to vector for correct channel.
166 
167  daqchannelmap::dchan chanid; //Channel ID
168  double fPeCorr=-1; //PECorr value to insert
169  double attencorr = 1.0;
170  size_t i=0;
171 
172  //Calibrator necessary to get Atten information
174 
175  //Loop over PCHits:
176  for (i = 0; i < cells->size(); ++i){
177 
178  const caldp::PCHit *cell = &cells->at(i);
179 
180  //Go to the next hit if something strange happened with path calculation:
181  if (cell->Path()<=0) continue;
182 
183  //Get the unique channel ID:
184  chanid = GetChanID(cell->Plane(),cell->Cell(),detid);
185 
186  //Check if channel was added to map:
187  if (mMeanPe.find(chanid) != mMeanPe.end() ) {
188 
189  //Make mock cellhit for use in Attenuation Calibrator
190  rb::CellHit cellhit;
191  cellhit.SetPlane(cell->Plane());
192  cellhit.SetCell(cell->Cell());
193 
194  //Set hit as data or MC
195  if (!isData) cellhit.SetMC();
196 
197  //Attenuation constant for this hit:
198  attencorr = calibrator->GetAttenScale(cellhit, cell->W());
199 
200  //Skip this hit if cell is not calibrated.
201  if (attencorr<=0) continue;
202 
203  //Correct the PE hit for Attenuation and Path length and add to vector:
204  fPeCorr = cell->PE()*attencorr/cell->Path();
205  mMeanPe[chanid].push_back(fPeCorr);
206 
207  }//End "if channel found in map"
208 
209  }//End cell loop
210 
211 }
212 
213 void DriftResponseCalc::CalculateMean(std::vector<double> &chanvector,double &fMean,double &fMeanErr,int &fNHits, double &fRMS){
214  ///Function returns truncated mean (fMean), error on mean (fMeanErr), number of hits in truncated mean (fNHits), and RMS of
215  ///response (fRMS) for vector of PECorrs for a single channel.
216 
217  //Initialize all to 0:
218  fNHits = 0;
219  fMean = 0;
220  fMeanErr = 0;
221 
222  //Sort the list:
223  std::sort(chanvector.begin(),chanvector.end());
224 
225  //Find boundary of the smallest 90% of hits
226  fNHits = (int)(chanvector.size()*9/10);
227 
228  //Return if there are too few hits in the final list
229  if (fNHits<=1) return;
230 
231  //Loop over the vector and calculate sum of hits
232  double dsum=0;
233  int i=0;
234  for (i=0; i<fNHits; ++i) dsum += chanvector[i];
235 
236  //Also number of hits, for use as double in math
237  double dnhits = (double)fNHits;
238 
239  //Calculate the mean:
240  fMean=dsum/dnhits;
241 
242  //Sum up difference from mean squared:
243  double dsumvar2=0;
244  for (i=0; i<fNHits; ++i) dsumvar2 += (chanvector[i]-fMean)*(chanvector[i]-fMean);
245 
246  //Unbiased estimate of true variance:
247  double dstdvar = sqrt(dsumvar2/(dnhits - 1));
248 
249  //Estimate of uncertainty on mean:
250  fMeanErr = dstdvar/sqrt(dnhits);
251  fRMS = dstdvar;
252 }
253 
254 void DriftResponseCalc::DrawMean(std::vector<double> &chanvector, TH1F *hpecorr){
255 
256  //Sort the list and grab bottom 90% of events:
257  std::sort(chanvector.begin(),chanvector.end());
258  int nhits = (int)(chanvector.size()*9/10);
259 
260  //Fill the histogram
261  for (int i=0; i<nhits; ++i) hpecorr->Fill(chanvector[i]);
262 
263 }
264 
265 
267 {
268 }
269 
271 {
272 
273  //Automatic assumption = we are running MC
274  isData = false;
275 
276  //We want to be able to handle any time possible.
279 
280  //Check if map of XY hits is filled; if not, define vectors for all maps.
281  //NOTE: Geometry service features dictate this must go in beginRun instead of beginJob.
282  if (mMeanPeXY.size()==0){
283 
284  //Geometry service:
286 
287  //Channel map service:
289 
290  //Detector identity:
291  novadaq::cnv::DetId detid = geom->DetId();
292 
293  //Plane, cell, channel ID output:
294  unsigned int planeid;
295  unsigned int cellid;
296  daqchannelmap::dchan chanid;
297 
298  //---Must make vector (for PCHits) for each FEB in detector.
299 
300  //Loop over X and Y views:
301  for (int view = geo::kX; view <= geo::kY; ++view){
302 
303  //Grab set of planes in that view from geometry
304  const std::set<unsigned int> planeSet =
306 
307  //Iterate over std:set of planes:
308  std::set<unsigned int >::iterator planeIter;
309  for (planeIter = planeSet.begin(); planeIter != planeSet.end(); ++planeIter){
310 
311  //Grab plane number for this entry
312  planeid = *planeIter;
313 
314  //Loop over cells in that plane:
315  for (unsigned int icx = 0; icx < geom->Plane(planeid)->Ncells(); ++icx){
316 
317  //Cell number is loop entry
318  cellid = icx;
319 
320  //Find FEB and create ID describing FEB and plane:
321  chanid = GetChanID(planeid,cellid,detid);
322 
323  //Check to see if running this diblock and dcm:
324  daqchannelmap::diblock_t diblock = cmap->Map()->getDiBlock(chanid);
325  daqchannelmap::dcm_id_t dcmnum = cmap->Map()->getDCM(chanid);
326 
327  //Are we supposed to run this DCM and DiBlock, according to fcl settings?
328  if ( ((fDiBlockNum>=0&&diblock==(unsigned int)fDiBlockNum)||fDiBlockNum<0) &&
329  ((fDCMNum>=0&&dcmnum==(unsigned int)fDCMNum)||fDCMNum<0) ){
330 
331  //Define new vector of hits for each map if FEB entry doesn't already exist.
332  if (mMeanPeXY.find(chanid) == mMeanPeXY.end()) {
333 
334  mMeanPeXY.insert(std::pair<daqchannelmap::dchan,std::vector<double> >(chanid,std::vector<double>()));
335  mMeanPeZ.insert(std::pair<daqchannelmap::dchan,std::vector<double> >(chanid,std::vector<double>()));
336  mMeanPeAvg.insert(std::pair<daqchannelmap::dchan,std::vector<double> >(chanid,std::vector<double>()));
337  }
338  }
339 
340  }//end cell loop
341  }//end plane loop
342  }//end view loop
343 
344  } else {
345 
346  //Clear out vectors for individual channels to start with:
347 
348  daqchannelmap::dchan channum;
349  std::map< daqchannelmap::dchan, std::vector<double> >::iterator chanIter;
350  for (chanIter = mMeanPeXY.begin(); chanIter != mMeanPeXY.end(); ++chanIter) {
351  channum = chanIter->first;
352  mMeanPeXY[channum].clear();
353  mMeanPeZ[channum].clear();
354  mMeanPeAvg[channum].clear();
355  }
356 
357  }
358 }
359 
360 
362 {
363 
364  //Check if this is Data:
365  //if (e.isRealData()) isData = true;
366 
367  //Geometry service
369 
370  //Grab detector ID from geometry
371  novadaq::cnv::DetId detid = geom->DetId();
372 
373  //---Grab collections of PCHits for each path quality--//
374  //Highest XY quality events:
376  e.getByLabel(fPCHitLabel, fQualXYName, cellsxy);
377  //Medium Z quality events:
379  e.getByLabel(fPCHitLabel, fQualZName, cellsz);
380  //Lowest Avg quality events:
382  e.getByLabel(fPCHitLabel, fQualAvgName, cellsavg);
383 
384  //Uncomment to access track/hit association:
385  //art::FindOne<rb::Track> fa(cellsxy, e, art::InputTag("caliblist", fQualXYName));
386 
387  //Update min and max times. This should later be edited with Jon Paley's info.
388  std::uint32_t evtTimeS = e.time().timeHigh();
389  eventTime.push_back(evtTimeS);
390  if (evtTimeS>maxTime) maxTime = evtTimeS;
391  if (evtTimeS<minTime) minTime = evtTimeS;
392 
393  //Fill all cell types!
394  FillPeCorrHits(cellsxy,mMeanPeXY,detid);
395  FillPeCorrHits(cellsz,mMeanPeZ,detid);
396  FillPeCorrHits(cellsavg,mMeanPeAvg,detid);
397 
398  //Uncomment to access association information, add own code.
399  // if(fa.at(i).isValid()){
400  // std::cout << "Track cells=" << fa.at(i).ref().NCell() << std::endl;
401  // }
402 
403 }//End produce function
404 
406 {
407 
408  //Geometry service:
410 
411  //Some information for histograms:
412  const std::set<unsigned int> planeSetX = geom->GetPlanesByView(geo::kX);
413  const std::set<unsigned int> planeSetY = geom->GetPlanesByView(geo::kY);
414  int nplanes = planeSetX.size() + planeSetY.size();
415 
416  //---Summary histograms for this run--------------//
417 
419 
420  hMeanDet = tfs->make<TH2F>("hMeanDet",
421  "Response Plane vs. FEB; Plane Number; FEB",
422  nplanes+1,0,nplanes+1,3,0,3.);
423 
424  hRMS = tfs->make<TH1F>("hRMS",
425  "RMS of Truncated Response; RMS of Truncated Response (PE); Modules",
426  100,0,100.);
427 
428  hMeanFrac = tfs->make<TH1F>("hMeanFrac",
429  "Fractional Error on Mean; Frac Error on Mean; Modules",
430  100,0,0.10);
431 
432  hNHits = tfs->make<TH1F>("hNHits",
433  "Number of Hits in FEB; Number of Hits in FEB; Modules",
434  1000,0,50000.);
435 
436  //-----------------------------------------------//
437 
438  //Ptr to DriftResp information:
439  std::unique_ptr<std::vector<caldp::DriftResponse > >fDriftResponse(new std::vector<caldp::DriftResponse >);
440 
441  //Run-specific values for Drift response
442  int fRun = r.run();
443 
444  //To be changed with Jon Paley's updated info
445  //art::Timestamp fStart = r.beginTime();
446  //art::Timestamp fEnd = r.endTime();
447 
448  caldp::DriftResponse driftresp(fRun,minTime,maxTime);
449 
450  //Remaining DriftResponse values to be calculated for each FEB:
451  double fMean =0;
452  double fRMS =0;
453  double fMeanErr=0;
454  int fNHits =0;
455  int fChanId =0;
456 
457  int FEBcount=0;
458  int prevplane=-1;
459  std::ofstream myfile;
460  if (fDrawMeans) {
461  myfile.open ("chaninfo.txt");
462  }
463 
465 
466  //Iterate over map of channels -> XY hits to start with.
467  std::map< daqchannelmap::dchan, std::vector<double> >::iterator chanIter;
468  for (chanIter = mMeanPeXY.begin(); chanIter != mMeanPeXY.end(); ++chanIter) {
469 
470  //Grab ID and vector for XY:
471  fChanId=chanIter->first;
472  std::vector<double> chanvector;
473 
474 
475  if (fFillType=="Successive"||fFillType=="Exclusive"){
476 
477  //vector of XY hits:
478  chanvector=chanIter->second;
479 
480  //Calculate mean, error on mean, rms, and number of hits for XY hits
481  fPathQual = calib::kXYAdjacents;
482  CalculateMean(chanvector,fMean,fMeanErr,fNHits,fRMS);
483 
484  //Not enough statistics. Add the Z hits.
485  if (fMean==0||(fMean>0&&fMeanErr/fMean>0.03)){
486  if (fFillType=="Exclusive") chanvector.clear();
487  chanvector.insert(chanvector.end(),
488  (mMeanPeZ.at(fChanId)).begin(),
489  (mMeanPeZ.at(fChanId)).end());
490 
491  //Re-calculate mean, etc. with Z hits added
492  fPathQual = calib::kZAdjacents;
493  CalculateMean(chanvector,fMean,fMeanErr,fNHits,fRMS);
494 
495  //Not enough statistics. Add the Avg hits.
496  if (fMean==0||(fMean>0&&fMeanErr/fMean>0.03)){
497  if (fFillType=="Exclusive") chanvector.clear();
498  chanvector.insert(chanvector.end(),
499  (mMeanPeAvg.at(fChanId)).begin(),
500  (mMeanPeAvg.at(fChanId)).end());
501 
502  //Re-calculate mean, etc. with Avg hits added
503  fPathQual = calib::kAverage;
504  CalculateMean(chanvector,fMean,fMeanErr,fNHits,fRMS);
505 
506 
507  }//(End calc with added Avg hits)
508 
509  }//(End calc with added Z hits)
510 
511  } else if (fFillType=="XY"){
512 
513  //Vector from iterator:
514  chanvector=chanIter->second;
515 
516  //Calculate mean, error on mean, and number of hits for XY hits:
517  fPathQual = calib::kXYAdjacents;
518  CalculateMean(chanvector,fMean,fMeanErr,fNHits,fRMS);
519 
520  } else if (fFillType=="Z"){
521 
522  //Z vector from other map:
523  chanvector.insert(chanvector.end(),
524  (mMeanPeZ.at(fChanId)).begin(),
525  (mMeanPeZ.at(fChanId)).end());
526 
527  //Calculate mean, error on mean, and number of hits for Z hits:
528  fPathQual = calib::kZAdjacents;
529  CalculateMean(chanvector,fMean,fMeanErr,fNHits,fRMS);
530 
531  } else if (fFillType=="Avg"){
532 
533  //Avg vector from other map:
534  chanvector.insert(chanvector.end(),
535  (mMeanPeAvg.at(fChanId)).begin(),
536  (mMeanPeAvg.at(fChanId)).end());
537 
538  //Calculate mean, error on mean, and number of hits for Avg hits:
539  fPathQual = calib::kAverage;
540  CalculateMean(chanvector,fMean,fMeanErr,fNHits,fRMS);
541 
542  }
543 
544  //Final calibrated value is not good enough:
545  if (fNHits==0){
546  fMean=-1;
547  fMeanErr=-1;
548  fRMS=-1;
549  }//(End failed calibration)
550 
551  if (fDrawMeans) {
552 
553  myfile << "//--------Statistics for ChanId=" << fChanId << " (initial size=" << chanvector.size() << ")\n";
554  myfile << "// Mean=" << fMean << "+/-" << fMeanErr << " RMS=" << fRMS << " n=" << fNHits << " qual=" << fPathQual <<"\n";
555 
556  std::string histname = Form("h_r%d_id%d",fRun,fChanId);
557 
558  srHistprint[fChanId] = tfs->make<TH1F>(Form("%s",histname.c_str()),
559  "Truncated PECorr;PECorr;Number of Hits",
560  200,0.,200.);
561  DrawMean(chanvector,srHistprint[fChanId]);
562 
563  }
564 
565  //Fill 2D response plot for (plane vs FEB)
566  int planefill = (int)(fChanId/1e6);
567  if (planefill==prevplane){
568  FEBcount++;
569  } else { FEBcount=0; }
570  prevplane=planefill;
571  if (fMean>0) {
572  hMeanDet->SetBinContent(planefill+1,FEBcount+1,fMean);
573  hMeanFrac->Fill(fMeanErr/fMean);
574  hRMS->Fill(fRMS);
575  hNHits->Fill(fNHits);
576  }
577 
578  //---Insert channel response-----//
579  if (!driftresp.CheckForChannel(fChanId))
580  driftresp.AddChannelResponse(fChanId,fMean,fMeanErr,fRMS,fNHits);
581 
582  }//(End calc over entries in XY hit map)
583 
584  fDriftResponse->push_back(driftresp);
585 
586  //Add the DriftResponse structure.
587  r.put(std::move(fDriftResponse));
588  if (fDrawMeans) myfile.close();
589 
590 }
591 
592 }//end namespace
std::map< daqchannelmap::dchan, std::vector< double > > mMeanPeZ
void beginRun(art::Run &r) override
Structure to hold drift response in a single channel at a single time.
Definition: DriftResponse.h:36
diblock
print "ROW IS " print row
Definition: geo2elec.py:31
void AddChannelResponse(int fOffChan, double fMean, double fMeanErr, double fRMS, int fNHits)
Return subrun end time.
std::string fFillType
Instance name, Avg qual hits.
int fDiBlockNum
Save response histograms to file, true/false?
const char * p
Definition: xmltok.h:285
T sqrt(T number)
Definition: d0nt_math.hpp:156
constexpr std::uint32_t timeHigh() const
Definition: Timestamp.h:34
Vertical planes which measure X.
Definition: PlaneGeo.h:28
unsigned int Ncells() const
Number of cells in this plane.
Definition: PlaneGeo.h:43
void DrawMean(std::vector< double > &chanvector, TH1F *hpecorr)
int Cell() const
Return cell value.
Definition: PCHit.h:26
std::string fQualXYName
Label of PCHit data.
const daqchannelmap::DAQChannelMap * Map() const
Definition: CMap.h:57
int fDCMNum
DiBlock Number to use (set to 0 with fDCMNum=0 to run all)
const PlaneGeo * Plane(unsigned int i) const
DEFINE_ART_MODULE(TestTMapFile)
lchan encodeLChan(int detId, plane_t plane, cell_t cell) const
void FillPeCorrHits(art::Handle< std::vector< caldp::PCHit > > &cells, std::map< daqchannelmap::dchan, std::vector< double > > &mMeanPe, novadaq::cnv::DetId detid)
Horizontal planes which measure Y.
Definition: PlaneGeo.h:29
void produce(art::Event &e) override
"Pre-calibration hit". Common input to calibration procedures
Definition: PCHit.h:16
float Path() const
Return Path value.
Definition: PCHit.h:42
Definition: Run.h:21
void SetPlane(unsigned short plane)
Definition: CellHit.h:53
float W() const
Return W value.
Definition: PCHit.h:44
void SetCell(unsigned short cell)
Definition: CellHit.h:52
CDPStorage service.
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Definition: DataViewImpl.h:446
std::map< daqchannelmap::dchan, std::vector< double > > mMeanPeAvg
Timestamp time() const
float PE() const
Return PE value.
Definition: PCHit.h:38
void beginJob()
double GetAttenScale(rb::CellHit const &cellhit, double w)
for PE->PECorr conversion
void reconfigure(fhicl::ParameterSet const &p)
T get(std::string const &key) const
Definition: ParameterSet.h:231
std::map< daqchannelmap::dchan, std::vector< double > > mMeanPeXY
DCM Number to use (set to 0 with fDiBlockNum=0 to run all)
novadaq::cnv::DetId DetId() const
Prefer ds::DetectorService::DetId() instead.
Definition: GeometryBase.h:243
uint32_t feb_t
Type for DCM link port. Counts from 0.
EPathQuality
Methods used to estimate path length of a track through a cell.
Definition: CalibUtil.h:40
RunNumber_t run() const
std::string fQualAvgName
Instance name, Z qual hits.
int Plane() const
Return plane value.
Definition: PCHit.h:24
bool fDrawMeans
Method for calculating means (which quals to use)
std::map< daqchannelmap::dchan, TH1F * > srHistprint
uint32_t dcm_id_t
Type for DCM number, counts from 1.
int nplanes
Definition: geom.C:145
void SetMC(bool isMC=true)
Definition: RawDigit.h:106
static float min(const float a, const float b, const float c)
Definition: absgeo.cxx:45
Histograms used by attenuation calibration.
bool CheckForChannel(int fOffChan) const
Return number of hits for given offline channel.
A rawdata::RawDigit with channel information decoded.
Definition: CellHit.h:27
uint32_t plane_t
Type for plane.
std::string fQualZName
Instance name, XY qual hits.
const std::set< unsigned int > & GetPlanesByView(View_t v=kXorY) const
void geom(int which=0)
Definition: geom.C:163
uint32_t diblock_t
Type for diblocks and blocks.
TRandom3 r(0)
dcm_id_t getDCM(dchan daqchan) const
Decode the dcm ID from a dchan.
dchan encodeDChan(int detID, diblock_t diblock, dcm_id_t dcm, feb_t feb, pixel_t pixel) const
daqchannelmap::dchan GetChanID(daqchannelmap::plane_t plane, daqchannelmap::cell_t cell, novadaq::cnv::DetId det)
Float_t e
Definition: plot.C:35
uint32_t dchan
< DAQ Channel Map Package
T max(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:66
ProductID put(std::unique_ptr< PROD > &&edp, FullSemantic< Level::Run > const semantic)
Definition: DataViewImpl.h:730
void endRun(art::Run &r) override
diblock_t getDiBlock(dchan daqchan) const
Decode the diblock ID from a dchan.
void CalculateMean(std::vector< double > &chanvector, double &fMean, double &fMeanErr, int &fNHits, double &fRMS)
Encapsulate the geometry of one entire detector (near, far, ndos)
feb_t getFEB(dchan daqchan) const
Decode the feb id from a dchan.
enum BeamMode string