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