All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
sbnd::CRTFullRecoAna Class Reference
Inheritance diagram for sbnd::CRTFullRecoAna:

Classes

struct  Config
 

Public Types

using Parameters = art::EDAnalyzer::Table< Config >
 

Public Member Functions

 CRTFullRecoAna (Parameters const &config)
 
virtual void beginJob () override
 
virtual void analyze (const art::Event &event) override
 
virtual void endJob () override
 

Private Attributes

art::InputTag fSimModuleLabel
 name of detsim producer More...
 
art::InputTag fCRTSimLabel
 name of CRT producer More...
 
art::InputTag fCRTHitLabel
 name of CRT producer More...
 
art::InputTag fCRTTrackLabel
 name of CRT producer More...
 
art::InputTag fTPCTrackLabel
 name of CRT producer More...
 
bool fVerbose
 print information about what's going on More...
 
TH1D * hCRTHitTimes
 
std::map< std::string, TH3D * > hTaggerXYZResolution
 
std::vector< std::string > stage {"CRTHit", "CRTTrack", "HitT0", "TrackT0"}
 
std::vector< std::string > category {"PossMatch", "ShouldMatch", "CRTVol", "TPCVol", "CRTCross", "TPCCross"}
 
std::vector< std::string > level {"Total", "Matched"}
 
TH1D * hEffMom [4][6][2]
 
TH1D * hEffTheta [4][6][2]
 
TH1D * hEffPhi [4][6][2]
 
std::vector< std::string > trackType {"Complete", "Incomplete", "Both"}
 
TH1D * hTrackThetaDiff [3]
 
TH1D * hTrackPhiDiff [3]
 
TH2D * hTrackTheta [3]
 
TH2D * hTrackPhi [3]
 
std::vector< std::string > t0Type {"HitT0", "TrackT0"}
 
std::vector< std::string > purity {"Matched", "Correct"}
 
TH1D * hPurityMom [2][2]
 
TH1D * hPurityTheta [2][2]
 
TH1D * hPurityPhi [2][2]
 
TPCGeoAlg fTpcGeo
 
CRTGeoAlg fCrtGeo
 
CRTT0MatchAlg crtT0Alg
 
CRTTrackMatchAlg crtTrackAlg
 
CRTBackTracker fCrtBackTrack
 

Detailed Description

Definition at line 79 of file CRTFullRecoAna_module.cc.

Member Typedef Documentation

using sbnd::CRTFullRecoAna::Parameters = art::EDAnalyzer::Table<Config>

Definition at line 132 of file CRTFullRecoAna_module.cc.

Constructor & Destructor Documentation

sbnd::CRTFullRecoAna::CRTFullRecoAna ( Parameters const &  config)
explicit

Definition at line 190 of file CRTFullRecoAna_module.cc.

191  : EDAnalyzer(config)
192  , fSimModuleLabel (config().SimModuleLabel())
193  , fCRTSimLabel (config().CRTSimLabel())
194  , fCRTHitLabel (config().CRTHitLabel())
195  , fCRTTrackLabel (config().CRTTrackLabel())
196  , fTPCTrackLabel (config().TPCTrackLabel())
197  , fVerbose (config().Verbose())
198  , crtT0Alg (config().CRTT0Alg())
199  , crtTrackAlg (config().CRTTrackAlg())
200  , fCrtBackTrack (config().CrtBackTrack())
201  {
202  }
BEGIN_PROLOG Verbose
bool fVerbose
print information about what&#39;s going on
BEGIN_PROLOG don t mess with this TPCTrackLabel
art::InputTag fTPCTrackLabel
name of CRT producer
art::InputTag fCRTTrackLabel
name of CRT producer
art::InputTag fCRTSimLabel
name of CRT producer
art::InputTag fSimModuleLabel
name of detsim producer
art::InputTag fCRTHitLabel
name of CRT producer

Member Function Documentation

void sbnd::CRTFullRecoAna::analyze ( const art::Event &  event)
overridevirtual

Definition at line 257 of file CRTFullRecoAna_module.cc.

258  {
259 
260  // Fetch basic event info
261  if(fVerbose){
262  std::cout<<"============================================"<<std::endl
263  <<"Run = "<<event.run()<<", SubRun = "<<event.subRun()<<", Event = "<<event.id().event()<<std::endl
264  <<"============================================"<<std::endl;
265  }
266 
267 
268  //----------------------------------------------------------------------------------------------------------
269  // GETTING PRODUCTS
270  //----------------------------------------------------------------------------------------------------------
271 
272  // Get g4 particles
273  art::ServiceHandle<cheat::ParticleInventoryService> pi_serv;
274  auto particleHandle = event.getValidHandle<std::vector<simb::MCParticle>>(fSimModuleLabel);
275 
276  // Get CRT hits from the event
277  art::Handle< std::vector<sbn::crt::CRTHit>> crtHitHandle;
278  std::vector<art::Ptr<sbn::crt::CRTHit> > crtHitList;
279  if (event.getByLabel(fCRTHitLabel, crtHitHandle))
280  art::fill_ptr_vector(crtHitList, crtHitHandle);
281 
282  // Get CRT tracks from the event
283  art::Handle< std::vector<sbn::crt::CRTTrack>> crtTrackHandle;
284  std::vector<art::Ptr<sbn::crt::CRTTrack> > crtTrackList;
285  if (event.getByLabel(fCRTTrackLabel, crtTrackHandle))
286  art::fill_ptr_vector(crtTrackList, crtTrackHandle);
287  art::FindManyP<sbn::crt::CRTHit> findManyCrtHits(crtTrackHandle, event, fCRTTrackLabel);
288 
289  // Get reconstructed tracks from the event
290  auto tpcTrackHandle = event.getValidHandle<std::vector<recob::Track>>(fTPCTrackLabel);
291  art::FindManyP<recob::Hit> findManyHits(tpcTrackHandle, event, fTPCTrackLabel);
292 
293  fCrtBackTrack.Initialize(event);
294 
295  //----------------------------------------------------------------------------------------------------------
296  // TRUTH MATCHING
297  //----------------------------------------------------------------------------------------------------------
298 
299  // Only evaluate performance over the time window that hits have been reconstructed
300  double minHitTime = 99999;
301  double maxHitTime = -99999;
302  for(auto const& hit : (*crtHitHandle)){
303  double hitTime = (double)(int)hit.ts1_ns * 1e-3;
304  if(hitTime < minHitTime) minHitTime = hitTime;
305  if(hitTime > maxHitTime) maxHitTime = hitTime;
306  }
307 
308  std::map<int, simb::MCParticle> particles;
309  std::map<int, CRTTruthMatch> truthMatching;
310  // Loop over the true particles
311  for (auto const& particle: (*particleHandle)){
312 
313  CRTTruthMatch truthMatch;
314  // Make map with ID
315  int partID = particle.TrackId();
316  particles[partID] = particle;
317 
318  // Only consider primary muons
319  if(!(std::abs(particle.PdgCode()) == 13 && particle.Mother()==0)) continue;
320 
321  double time = particle.T() * 1e-3;
322  if(time < minHitTime || time > maxHitTime) continue;
323 
324  truthMatch.partID = partID;
325  truthMatch.trueT0 = time;
326  truthMatch.hasTpcTrack = false;
327 
328  // Loop over the taggers
329  for(size_t i = 0; i < fCrtGeo.NumTaggers(); i++){
330  std::string taggerName = fCrtGeo.GetTagger(i).name;
331  // Find the intersections between the true particle and each tagger (if exists)
332  geo::Point_t trueCP = fCrtGeo.TaggerCrossingPoint(taggerName, particle);
333  // Make map for each tagger with true ID as key and value an XYZ position
334  if(trueCP.X() != -99999){
335  truthMatch.trueCrosses[taggerName] = trueCP;
336  }
337  bool validCP = fCrtGeo.ValidCrossingPoint(taggerName, particle);
338  truthMatch.validCrosses[taggerName] = validCP;
339  }
340 
341  truthMatching[partID] = truthMatch;
342 
343  }
344 
345  //--------------------------------------------- CRT HIT MATCHING -------------------------------------------
346 
347  // Loop over CRT hits
348  std::vector<sbn::crt::CRTHit> crtHits;
349  int hit_i = 0;
350  for (auto const& crtHit: (*crtHitHandle)){
351  crtHits.push_back(crtHit);
352  // Get tagger of CRT hit
353  std::string taggerName = crtHit.tagger;
354 
355  hCRTHitTimes->Fill(crtHit.ts1_ns*1e-3);
356 
357  // Get associated true particle
358  int partID = fCrtBackTrack.TrueIdFromHitId(event, hit_i);
359  hit_i++;
360  if(truthMatching.find(partID) == truthMatching.end()) continue;
361 
362  truthMatching[partID].crtHits[taggerName].push_back(crtHit);
363  }
364 
365  //------------------------------------------- CRT TRACK MATCHING -------------------------------------------
366 
367  // Loop over CRT tracks
368  std::vector<sbn::crt::CRTTrack> crtTracks;
369  int track_i = 0;
370  for (auto const& crtTrack : (*crtTrackHandle)){
371  crtTracks.push_back(crtTrack);
372 
373  // Get associated true particle
374  int partID = fCrtBackTrack.TrueIdFromTrackId(event, track_i);
375  track_i++;
376  if(truthMatching.find(partID) == truthMatching.end()) continue;
377 
378  truthMatching[partID].crtTracks.push_back(crtTrack);
379 
380  }
381 
382  //------------------------------------------- CRT T0 MATCHING ----------------------------------------------
383 
384  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(event);
385  auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(event, clockData);
386 
387  // Loop over reconstructed tracks
388  for (auto const& tpcTrack : (*tpcTrackHandle)){
389  // Get the associated true particle
390  std::vector<art::Ptr<recob::Hit>> hits = findManyHits.at(tpcTrack.ID());
391  int partID = RecoUtils::TrueParticleIDFromTotalRecoHits(clockData, hits, false);
392  if(truthMatching.find(partID) == truthMatching.end()) continue;
393  truthMatching[partID].hasTpcTrack = true;
394 
395  // Calculate t0 from CRT Hit matching
396  //int tpc = fTpcGeo.DetectedInTPC(hits);
397  double hitT0 = crtT0Alg.T0FromCRTHits(detProp, tpcTrack, crtHits, event);
398  if(hitT0 != -99999) truthMatching[partID].hitT0s.push_back(hitT0);
399 
400  // Calculate t0 from CRT Track matching
401  double trackT0 = crtTrackAlg.T0FromCRTTracks(detProp, tpcTrack, crtTracks, event);
402  if(trackT0 != -99999) truthMatching[partID].trackT0s.push_back(trackT0);
403 
404  }
405 
406  //----------------------------------------------------------------------------------------------------------
407  // PERFORMANCE METRICS
408  //----------------------------------------------------------------------------------------------------------
409  // Loop over all the true particles in the event inside the reco window
410  for(auto const& truthMatch : truthMatching){
411  CRTTruthMatch match = truthMatch.second;
412  int partID = match.partID;
413 
414  double momentum = particles[partID].P();
415  TVector3 start(particles[partID].Vx(), particles[partID].Vy(), particles[partID].Vz());
416  TVector3 end(particles[partID].EndX(), particles[partID].EndY(), particles[partID].EndZ());
417  double theta = (end-start).Theta();
418  double phi = (end-start).Phi();
419 
420  //--------------------------------- CRT HIT RECONSTRUCTION PERFORMANCE -------------------------------------
421  // Loop over the true crossing points
422  for(auto const& trueCross : match.trueCrosses){
423  // Find the closest matched reconstructed hit on that tagger
424  std::string taggerName = trueCross.first;
425  geo::Point_t trueCP = trueCross.second;
426 
427  double minDist = 99999;
428  sbn::crt::CRTHit closestHit;
429  // Loop over the associated CRTHits and find the closest
430  if(match.crtHits.find(taggerName) == match.crtHits.end()) continue;
431  for(auto const& crtHit : match.crtHits[taggerName]){
432  double dist = pow(crtHit.x_pos-trueCP.X(), 2) + pow(crtHit.y_pos-trueCP.Y(), 2) + pow(crtHit.z_pos-trueCP.Z(), 2);
433  if(dist < minDist){
434  closestHit = crtHit;
435  minDist = dist;
436  }
437  }
438  // RESOLUTIONS
439  // Fill the histogram of resolutions for that tagger
440  if(minDist != 99999){
441  hTaggerXYZResolution[taggerName]->Fill(closestHit.x_pos-trueCP.X(), closestHit.y_pos-trueCP.Y(), closestHit.z_pos-trueCP.Z());
442  }
443  }
444 
445  //------------------------------- CRT TRACK RECONSTRUCTION PERFORMANCE -------------------------------------
446 
447  // RESOLUTIONS
448  double minThetaDiff = 99999;
449  double minPhiDiff = 99999;
450  double minTheta = 99999;
451  double minPhi = 99999;
452  bool complete = true;
453  // Get true theta and phi in CRT volume
454  simb::MCParticle particle = particles[match.partID];
455  TVector3 trueStart(particle.Vx(), particle.Vy(), particle.Vz());
456  TVector3 trueEnd(particle.EndX(), particle.EndY(), particle.EndZ());
457  if(trueEnd.Y() > trueStart.Y()) std::swap(trueStart, trueEnd);
458  double trueTheta = (trueEnd - trueStart).Theta();
459  double truePhi = (trueEnd - trueStart).Phi();
460  // Loop over the associated CRT tracks and find the one with the closest angle
461  for(auto const& crtTrack : match.crtTracks){
462  // Take largest y point as the start
463  TVector3 recoStart(crtTrack.x1_pos, crtTrack.y1_pos, crtTrack.z1_pos);
464  TVector3 recoEnd(crtTrack.x2_pos, crtTrack.y2_pos, crtTrack.z2_pos);
465  if(recoEnd.Y() > recoStart.Y()) std::swap(recoStart, recoEnd);
466  double recoTheta = (recoEnd - recoStart).Theta();
467  double recoPhi = (recoEnd - recoStart).Phi();
468  double thetaDiff = TMath::ATan2(TMath::Sin(recoTheta-trueTheta), TMath::Cos(recoTheta-trueTheta));
469  double phiDiff = TMath::ATan2(TMath::Sin(recoPhi-truePhi), TMath::Cos(recoPhi-truePhi));
470  if(thetaDiff < minThetaDiff){
471  minThetaDiff = thetaDiff;
472  minPhiDiff = phiDiff;
473  minTheta = recoTheta;
474  minPhi = recoPhi;
475  complete = crtTrack.complete;
476  }
477  }
478  // Fill theta, phi difference plots for complete/incomplete tracks (maybe consider entry/exit points)
479  if(minThetaDiff != 99999){
480  if(complete){
481  hTrackThetaDiff[0]->Fill(minThetaDiff);
482  hTrackPhiDiff[0]->Fill(minPhiDiff);
483  hTrackTheta[0]->Fill(trueTheta, minTheta);
484  hTrackPhi[0]->Fill(truePhi, minPhi);
485  }
486  else{
487  hTrackThetaDiff[1]->Fill(minThetaDiff);
488  hTrackPhiDiff[1]->Fill(minPhiDiff);
489  hTrackTheta[1]->Fill(trueTheta, minTheta);
490  hTrackPhi[1]->Fill(truePhi, minPhi);
491  }
492  hTrackThetaDiff[2]->Fill(minThetaDiff);
493  hTrackPhiDiff[2]->Fill(minPhiDiff);
494  hTrackTheta[2]->Fill(trueTheta, minTheta);
495  hTrackPhi[2]->Fill(truePhi, minPhi);
496  }
497 
498  //--------------------------------------- CRT HIT T0 PERFORMANCE -------------------------------------------
499 
500  // PURITY
501  // Loop over the associated T0s and find the one from the longest reco track
502  // If it is within a certain time then fill plots with angles, momentum, reco length
503  double bestHitT0Diff = 99999;
504  for(auto const& hitT0 : match.hitT0s){
505  double hitT0Diff = std::abs(match.trueT0 - hitT0);
506  if(hitT0Diff < bestHitT0Diff) bestHitT0Diff = hitT0Diff;
507  }
508  if(bestHitT0Diff != 99999){
509  hPurityMom[0][0]->Fill(momentum);
510  hPurityTheta[0][0]->Fill(theta);
511  hPurityPhi[0][0]->Fill(phi);
512  }
513  if(bestHitT0Diff < 2){
514  hPurityMom[0][1]->Fill(momentum);
515  hPurityTheta[0][1]->Fill(theta);
516  hPurityPhi[0][1]->Fill(phi);
517  }
518 
519  //------------------------------------- CRT TRACK T0 PERFORMANCE -------------------------------------------
520  // PURITY
521  // Loop over the associated T0s and find the one from the longest reco track
522  // If it is within a certain time then fill plots with angles, momentum, reco length
523  double bestTrackT0Diff = 99999;
524  for(auto const& trackT0 : match.trackT0s){
525  double trackT0Diff = std::abs(match.trueT0 - trackT0);
526  if(trackT0Diff < bestTrackT0Diff) bestTrackT0Diff = trackT0Diff;
527  }
528  if(bestTrackT0Diff != 99999){
529  hPurityMom[1][0]->Fill(momentum);
530  hPurityTheta[1][0]->Fill(theta);
531  hPurityPhi[1][0]->Fill(phi);
532  }
533  if(bestTrackT0Diff < 2){
534  hPurityMom[1][1]->Fill(momentum);
535  hPurityTheta[1][1]->Fill(theta);
536  hPurityPhi[1][1]->Fill(phi);
537  }
538 
539  // --------------------------------- EFFICIENCIES FOR EVERYTHING -------------------------------------------
540  // If there are any matched T0s then fill plots with angles, momentum, reco length for different categories
541  bool matchesCRTHit = (match.crtHits.size() > 0);
542  bool matchesCRTTrack = (match.crtTracks.size() > 0);
543  bool matchesHitT0 = (match.hitT0s.size() > 0);
544  bool matchesTrackT0 = (match.trackT0s.size() > 0);
545  std::vector<bool> matches{matchesCRTHit, matchesCRTTrack, matchesHitT0, matchesTrackT0};
546 
547  std::vector<bool> crtHitCategories;
548  std::vector<bool> crtTrackCategories;
549  std::vector<bool> hitT0Categories;
550  std::vector<bool> trackT0Categories;
551 
552  // - Possible match (hits & hitT0: cross >= 1 tagger, tracks & trackT0: cross >= 2 taggers)
553  crtHitCategories.push_back((match.trueCrosses.size() > 0));
554  crtTrackCategories.push_back((match.trueCrosses.size() > 1));
555  hitT0Categories.push_back((match.trueCrosses.size() > 0) && match.hasTpcTrack);
556  trackT0Categories.push_back((match.trueCrosses.size() > 1) && match.hasTpcTrack);
557 
558  // - Should match: (hits: cross 2 perp strips in tagger, tracks: cross 2 perp strips in 2 taggers,
559  // hitT0: hit and tpc track associated, trackT0: crt and tpc track associated)
560  bool validHit = false;
561  for(auto const& valid : match.validCrosses){
562  if(valid.second) validHit = true;
563  }
564  crtHitCategories.push_back(validHit);
565  crtTrackCategories.push_back(match.crtHits.size() > 1);
566  hitT0Categories.push_back((match.crtHits.size() > 0 && match.hasTpcTrack));
567  trackT0Categories.push_back((match.crtTracks.size() > 0 && match.hasTpcTrack));
568 
569  // - Enters CRT volume
570  bool entersCRT = fCrtGeo.EntersVolume(particles[partID]);
571  crtHitCategories.push_back(entersCRT);
572  crtTrackCategories.push_back(entersCRT);
573  hitT0Categories.push_back((entersCRT && match.hasTpcTrack));
574  trackT0Categories.push_back((entersCRT && match.hasTpcTrack));
575 
576  // - Enters TPC volume
577  bool entersTPC = fTpcGeo.EntersVolume(particles[partID]) && entersCRT;
578  crtHitCategories.push_back(entersTPC);
579  crtTrackCategories.push_back(entersTPC);
580  hitT0Categories.push_back((entersTPC && match.hasTpcTrack));
581  trackT0Categories.push_back((entersTPC && match.hasTpcTrack));
582 
583  // - Crosses CRT volume
584  bool crossesCRT = fCrtGeo.CrossesVolume(particles[partID]);
585  crtHitCategories.push_back(crossesCRT);
586  crtTrackCategories.push_back(crossesCRT);
587  hitT0Categories.push_back((crossesCRT && match.hasTpcTrack));
588  trackT0Categories.push_back((crossesCRT && match.hasTpcTrack));
589 
590  // - Crosses TPC volume
591  bool crossesTPC = fTpcGeo.CrossesVolume(particles[partID]) && entersCRT;
592  crtHitCategories.push_back(crossesTPC);
593  crtTrackCategories.push_back(crossesTPC);
594  hitT0Categories.push_back((crossesTPC && match.hasTpcTrack));
595  trackT0Categories.push_back((crossesTPC && match.hasTpcTrack));
596 
597  std::vector<std::vector<bool>> matchCategories{crtHitCategories, crtTrackCategories, hitT0Categories, trackT0Categories};
598 
599  for(size_t si = 0; si < stage.size(); si++){
600  for(size_t ci = 0; ci < category.size(); ci++){
601  if(!matchCategories[si][ci]) continue;
602  hEffMom[si][ci][0]->Fill(momentum);
603  hEffTheta[si][ci][0]->Fill(theta);
604  hEffPhi[si][ci][0]->Fill(phi);
605 
606  if(!matches[si]) continue;
607  hEffMom[si][ci][1]->Fill(momentum);
608  hEffTheta[si][ci][1]->Fill(theta);
609  hEffPhi[si][ci][1]->Fill(phi);
610  }
611  }
612  }
613 
614  } // CRTFullRecoAna::analyze()
int TrueIdFromTrackId(const art::Event &event, int track_i)
bool CrossesVolume(const simb::MCParticle &particle)
CRTTaggerGeo GetTagger(std::string taggerName) const
bool fVerbose
print information about what&#39;s going on
std::map< std::string, TH3D * > hTaggerXYZResolution
process_name hit
Definition: cheaterreco.fcl:51
int TrueIdFromHitId(const art::Event &event, int hit_i)
float z_pos
position in z-direction (cm).
Definition: CRTHit.hh:42
T abs(T value)
auto end(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:585
bool EntersVolume(const simb::MCParticle &particle)
int TrueParticleIDFromTotalRecoHits(detinfo::DetectorClocksData const &clockData, const std::vector< art::Ptr< recob::Hit > > &hits, bool rollup_unsaved_ids=1)
art::InputTag fTPCTrackLabel
name of CRT producer
art::InputTag fCRTTrackLabel
name of CRT producer
float y_pos
position in y-direction (cm).
Definition: CRTHit.hh:40
double T0FromCRTHits(detinfo::DetectorPropertiesData const &detProp, recob::Track tpcTrack, std::vector< sbn::crt::CRTHit > crtHits, const art::Event &event)
std::vector< std::string > stage
constexpr double dist(const TReal *x, const TReal *y, const unsigned int dimension)
geo::Point_t TaggerCrossingPoint(std::string taggerName, const simb::MCParticle &particle)
float x_pos
position in x-direction (cm).
Definition: CRTHit.hh:38
std::vector< std::string > category
do i e
art::InputTag fSimModuleLabel
name of detsim producer
bool EntersVolume(const simb::MCParticle &particle)
double T0FromCRTTracks(detinfo::DetectorPropertiesData const &detProp, recob::Track tpcTrack, std::vector< sbn::crt::CRTTrack > crtTracks, const art::Event &event)
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:184
art::InputTag fCRTHitLabel
name of CRT producer
bool ValidCrossingPoint(std::string taggerName, const simb::MCParticle &particle)
BEGIN_PROLOG could also be cout
auto const detProp
bool CrossesVolume(const simb::MCParticle &particle)
void sbnd::CRTFullRecoAna::beginJob ( )
overridevirtual

Definition at line 204 of file CRTFullRecoAna_module.cc.

205  {
206  // Access tfileservice to handle creating and writing histograms
207  art::ServiceHandle<art::TFileService> tfs;
208 
209  hCRTHitTimes = tfs->make<TH1D>("CRTHitTimes","",100, -5000, 5000);
210 
211  for(size_t i = 0; i < fCrtGeo.NumTaggers(); i++){
212  std::string taggerName = fCrtGeo.GetTagger(i).name;
213  TString histName = Form("%s_resolution", taggerName.c_str());
214  hTaggerXYZResolution[taggerName] = tfs->make<TH3D>(histName, "", 50, -25, 25, 50, -25, 25, 50, -25, 25);
215  }
216 
217  for(size_t si = 0; si < stage.size(); si++){
218  for(size_t ci = 0; ci < category.size(); ci++){
219  for(size_t li = 0; li < level.size(); li++){
220  TString momName = Form("MuMom%s_%s_%s", stage[si].c_str(), category[ci].c_str(), level[li].c_str());
221  hEffMom[si][ci][li] = tfs->make<TH1D>(momName, "", 20, 0, 10);
222  TString thetaName = Form("MuTheta%s_%s_%s", stage[si].c_str(), category[ci].c_str(), level[li].c_str());
223  hEffTheta[si][ci][li] = tfs->make<TH1D>(thetaName, "", 20, 0, 3.2);
224  TString phiName = Form("MuPhi%s_%s_%s", stage[si].c_str(), category[ci].c_str(), level[li].c_str());
225  hEffPhi[si][ci][li] = tfs->make<TH1D>(phiName, "", 20, -3.2, 3.2);
226  }
227  }
228  }
229 
230  for(size_t ti = 0; ti < trackType.size(); ti++){
231  TString thetaDiffName = Form("TrackThetaDiff%s", trackType[ti].c_str());
232  hTrackThetaDiff[ti] = tfs->make<TH1D>(thetaDiffName, "", 50, -0.2, 0.2);
233  TString phiDiffName = Form("TrackPhiDiff%s", trackType[ti].c_str());
234  hTrackPhiDiff[ti] = tfs->make<TH1D>(phiDiffName, "", 50, -0.2, 0.2);
235  TString thetaName = Form("TrackTheta%s", trackType[ti].c_str());
236  hTrackTheta[ti] = tfs->make<TH2D>(thetaName, "", 20, 0, 3.2, 20, 0, 3.2);
237  TString phiName = Form("TrackPhi%s", trackType[ti].c_str());
238  hTrackPhi[ti] = tfs->make<TH2D>(phiName, "", 20, -3.2, 0, 20, -3.2, 0);
239  }
240 
241  for(size_t ti = 0; ti < t0Type.size(); ti++){
242  for(size_t pi = 0; pi < purity.size(); pi++){
243  TString momName = Form("PurityMom%s_%s", t0Type[ti].c_str(), purity[pi].c_str());
244  hPurityMom[ti][pi] = tfs->make<TH1D>(momName, "", 20, 0, 10);
245  TString thetaName = Form("PurityTheta%s_%s", t0Type[ti].c_str(), purity[pi].c_str());
246  hPurityTheta[ti][pi] = tfs->make<TH1D>(thetaName, "", 20, 0, 3.2);
247  TString phiName = Form("PurityPhi%s_%s", t0Type[ti].c_str(), purity[pi].c_str());
248  hPurityPhi[ti][pi] = tfs->make<TH1D>(phiName, "", 20, -3.2, 3.2);
249  }
250  }
251 
252  // Initial output
253  std::cout<<"----------------- Full CRT Reconstruction Analysis Module -------------------"<<std::endl;
254 
255  }// CRTFullRecoAna::beginJob()
std::vector< std::string > level
CRTTaggerGeo GetTagger(std::string taggerName) const
std::map< std::string, TH3D * > hTaggerXYZResolution
pdgs pi
Definition: selectors.fcl:22
std::vector< std::string > trackType
std::vector< std::string > stage
std::vector< std::string > purity
std::vector< std::string > category
art::ServiceHandle< art::TFileService > tfs
std::vector< std::string > t0Type
BEGIN_PROLOG could also be cout
void sbnd::CRTFullRecoAna::endJob ( )
overridevirtual

Definition at line 616 of file CRTFullRecoAna_module.cc.

616  {
617 
618  } // CRTFullRecoAna::endJob()

Member Data Documentation

std::vector<std::string> sbnd::CRTFullRecoAna::category {"PossMatch", "ShouldMatch", "CRTVol", "TPCVol", "CRTCross", "TPCCross"}
private

Definition at line 161 of file CRTFullRecoAna_module.cc.

CRTT0MatchAlg sbnd::CRTFullRecoAna::crtT0Alg
private

Definition at line 182 of file CRTFullRecoAna_module.cc.

CRTTrackMatchAlg sbnd::CRTFullRecoAna::crtTrackAlg
private

Definition at line 183 of file CRTFullRecoAna_module.cc.

CRTBackTracker sbnd::CRTFullRecoAna::fCrtBackTrack
private

Definition at line 185 of file CRTFullRecoAna_module.cc.

CRTGeoAlg sbnd::CRTFullRecoAna::fCrtGeo
private

Definition at line 180 of file CRTFullRecoAna_module.cc.

art::InputTag sbnd::CRTFullRecoAna::fCRTHitLabel
private

name of CRT producer

Definition at line 151 of file CRTFullRecoAna_module.cc.

art::InputTag sbnd::CRTFullRecoAna::fCRTSimLabel
private

name of CRT producer

Definition at line 150 of file CRTFullRecoAna_module.cc.

art::InputTag sbnd::CRTFullRecoAna::fCRTTrackLabel
private

name of CRT producer

Definition at line 152 of file CRTFullRecoAna_module.cc.

art::InputTag sbnd::CRTFullRecoAna::fSimModuleLabel
private

name of detsim producer

Definition at line 149 of file CRTFullRecoAna_module.cc.

TPCGeoAlg sbnd::CRTFullRecoAna::fTpcGeo
private

Definition at line 179 of file CRTFullRecoAna_module.cc.

art::InputTag sbnd::CRTFullRecoAna::fTPCTrackLabel
private

name of CRT producer

Definition at line 153 of file CRTFullRecoAna_module.cc.

bool sbnd::CRTFullRecoAna::fVerbose
private

print information about what's going on

Definition at line 154 of file CRTFullRecoAna_module.cc.

TH1D* sbnd::CRTFullRecoAna::hCRTHitTimes
private

Definition at line 157 of file CRTFullRecoAna_module.cc.

TH1D* sbnd::CRTFullRecoAna::hEffMom[4][6][2]
private

Definition at line 163 of file CRTFullRecoAna_module.cc.

TH1D* sbnd::CRTFullRecoAna::hEffPhi[4][6][2]
private

Definition at line 165 of file CRTFullRecoAna_module.cc.

TH1D* sbnd::CRTFullRecoAna::hEffTheta[4][6][2]
private

Definition at line 164 of file CRTFullRecoAna_module.cc.

TH1D* sbnd::CRTFullRecoAna::hPurityMom[2][2]
private

Definition at line 175 of file CRTFullRecoAna_module.cc.

TH1D* sbnd::CRTFullRecoAna::hPurityPhi[2][2]
private

Definition at line 177 of file CRTFullRecoAna_module.cc.

TH1D* sbnd::CRTFullRecoAna::hPurityTheta[2][2]
private

Definition at line 176 of file CRTFullRecoAna_module.cc.

std::map<std::string, TH3D*> sbnd::CRTFullRecoAna::hTaggerXYZResolution
private

Definition at line 158 of file CRTFullRecoAna_module.cc.

TH2D* sbnd::CRTFullRecoAna::hTrackPhi[3]
private

Definition at line 171 of file CRTFullRecoAna_module.cc.

TH1D* sbnd::CRTFullRecoAna::hTrackPhiDiff[3]
private

Definition at line 169 of file CRTFullRecoAna_module.cc.

TH2D* sbnd::CRTFullRecoAna::hTrackTheta[3]
private

Definition at line 170 of file CRTFullRecoAna_module.cc.

TH1D* sbnd::CRTFullRecoAna::hTrackThetaDiff[3]
private

Definition at line 168 of file CRTFullRecoAna_module.cc.

std::vector<std::string> sbnd::CRTFullRecoAna::level {"Total", "Matched"}
private

Definition at line 162 of file CRTFullRecoAna_module.cc.

std::vector<std::string> sbnd::CRTFullRecoAna::purity {"Matched", "Correct"}
private

Definition at line 174 of file CRTFullRecoAna_module.cc.

std::vector<std::string> sbnd::CRTFullRecoAna::stage {"CRTHit", "CRTTrack", "HitT0", "TrackT0"}
private

Definition at line 160 of file CRTFullRecoAna_module.cc.

std::vector<std::string> sbnd::CRTFullRecoAna::t0Type {"HitT0", "TrackT0"}
private

Definition at line 173 of file CRTFullRecoAna_module.cc.

std::vector<std::string> sbnd::CRTFullRecoAna::trackType {"Complete", "Incomplete", "Both"}
private

Definition at line 167 of file CRTFullRecoAna_module.cc.


The documentation for this class was generated from the following file: