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

Classes

struct  BeamTime
 
struct  Config
 

Public Types

using Parameters = art::EDAnalyzer::Table< Config >
 
typedef art::Handle
< std::vector
< recob::PFParticle > > 
PFParticleHandle
 
typedef std::map< size_t,
art::Ptr< recob::PFParticle > > 
PFParticleIdMap
 

Public Member Functions

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

Private Member Functions

void GetPFParticleIdMap (const PFParticleHandle &pfParticleHandle, PFParticleIdMap &pfParticleMap)
 

Private Attributes

art::InputTag fSimModuleLabel
 name of detsim producer More...
 
art::InputTag fTpcTrackModuleLabel
 name of TPC track producer More...
 
art::InputTag fPandoraLabel
 
bool fVerbose
 print information about what's going on More...
 
double fBeamTimeMin
 
double fBeamTimeMax
 
CosmicIdAlg cosIdAlg
 
TPCGeoAlg fTpcGeo
 
trkf::TrajectoryMCSFitter fMcsFitter
 
trkf::TrackMomentumCalculator fRangeFitter
 
std::vector< std::string > trueCategories {"NuMu","Dirt","Cr","Other"}
 
size_t nTC = trueCategories.size()
 
std::vector< std::string > recoCategories {"NuMu","Dirt","Cr","Other","OtherNu"}
 
size_t nRC = recoCategories.size()
 
std::vector< std::string > cuts {"None","FV","SP","Geo","CC","AC","CT","CH","PT","PN","Tot","Remain"}
 
size_t nCuts = cuts.size()
 
TH1D * hBeamTime
 
TH1D * hTrueMom [4][12]
 
TH1D * hTrueLength [4][12]
 
TH1D * hTrueTheta [4][12]
 
TH1D * hTruePhi [4][12]
 
TH1D * hRecoMom [5][12]
 
TH1D * hRecoLength [5][12]
 
TH1D * hRecoTheta [5][12]
 
TH1D * hRecoPhi [5][12]
 

Detailed Description

Definition at line 55 of file CosmicIdAna_module.cc.

Member Typedef Documentation

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

Definition at line 115 of file CosmicIdAna_module.cc.

typedef art::Handle< std::vector<recob::PFParticle> > sbnd::CosmicIdAna::PFParticleHandle

Definition at line 129 of file CosmicIdAna_module.cc.

typedef std::map< size_t, art::Ptr<recob::PFParticle> > sbnd::CosmicIdAna::PFParticleIdMap

Definition at line 130 of file CosmicIdAna_module.cc.

Constructor & Destructor Documentation

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

Definition at line 176 of file CosmicIdAna_module.cc.

177  : EDAnalyzer(config)
178  , fSimModuleLabel (config().SimModuleLabel())
179  , fTpcTrackModuleLabel (config().TpcTrackModuleLabel())
180  , fPandoraLabel (config().PandoraLabel())
181  , fVerbose (config().Verbose())
182  , fBeamTimeMin (config().BeamTimeLimits().BeamTimeMin())
183  , fBeamTimeMax (config().BeamTimeLimits().BeamTimeMax())
184  , cosIdAlg (config().CosIdAlg())
185  , fMcsFitter (config().fitter)
186  {
187 
188  } // CosmicIdAna()
BEGIN_PROLOG Verbose
trkf::TrajectoryMCSFitter fMcsFitter
art::InputTag fTpcTrackModuleLabel
name of TPC track producer
art::InputTag fSimModuleLabel
name of detsim producer
art::InputTag fPandoraLabel
bool fVerbose
print information about what&#39;s going on

Member Function Documentation

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

Definition at line 230 of file CosmicIdAna_module.cc.

231  {
232 
233  // Fetch basic event info
234  if(fVerbose){
235  std::cout<<"============================================"<<std::endl
236  <<"Run = "<<event.run()<<", SubRun = "<<event.subRun()<<", Event = "<<event.id().event()<<std::endl
237  <<"============================================"<<std::endl;
238  }
239 
240  //----------------------------------------------------------------------------------------------------------
241  // GETTING PRODUCTS
242  //----------------------------------------------------------------------------------------------------------
243 
244  // Get truth info and matching
245  art::ServiceHandle<cheat::ParticleInventoryService> pi_serv;
246  // Retrieve all the truth info in the events
247  auto particleHandle = event.getValidHandle<std::vector<simb::MCParticle>>(fSimModuleLabel);
248 
249  // Get PFParticles from pandora
250  PFParticleHandle pfParticleHandle;
251  event.getByLabel(fPandoraLabel, pfParticleHandle);
252  if( !pfParticleHandle.isValid() ){
253  if(fVerbose) std::cout<<"Failed to find the PFParticles."<<std::endl;
254  return;
255  }
256  PFParticleIdMap pfParticleMap;
257  this->GetPFParticleIdMap(pfParticleHandle, pfParticleMap);
258  // Get PFParticle to track associations
259  art::FindManyP< recob::Track > pfPartToTrackAssoc(pfParticleHandle, event, fTpcTrackModuleLabel);
260 
261  // Get track to hit and colorimetry associations
262  auto tpcTrackHandle = event.getValidHandle<std::vector<recob::Track>>(fTpcTrackModuleLabel);
263  art::FindManyP<recob::Hit> findManyHits(tpcTrackHandle, event, fTpcTrackModuleLabel);
264 
265  //----------------------------------------------------------------------------------------------------------
266  // TRUTH MATCHING
267  //----------------------------------------------------------------------------------------------------------
268 
269  // Record all true particles and sort by type
270  std::map<int, simb::MCParticle> particles;
271  std::vector<simb::MCParticle> parts;
272  std::vector<int> nuParticleIds;
273  std::vector<int> lepParticleIds;
274  std::vector<int> dirtParticleIds;
275  std::vector<int> crParticleIds;
276 
277  // Loop over all true particles
278  for (auto const& particle: (*particleHandle)){
279  // Store particle
280  int partId = particle.TrackId();
281  particles[partId] = particle;
282  parts.push_back(particle);
283  // Get MCTruth
284  art::Ptr<simb::MCTruth> truth = pi_serv->TrackIdToMCTruth_P(partId);
285  int pdg = std::abs(particle.PdgCode());
286 
287  // If origin is a neutrino
288  if(truth->Origin() == simb::kBeamNeutrino){
289  geo::Point_t vtx;
290  vtx.SetX(truth->GetNeutrino().Nu().Vx()); vtx.SetY(truth->GetNeutrino().Nu().Vy()); vtx.SetZ(truth->GetNeutrino().Nu().Vz());
291  // If neutrino vertex is not inside the TPC then call it a dirt particle
292  if(!fTpcGeo.InFiducial(vtx, 0.)){
293  dirtParticleIds.push_back(partId);
294  }
295  // If it's a primary muon
296  else if(pdg==13 && particle.Mother()==0){
297  lepParticleIds.push_back(partId);
298  }
299  // Other nu particles
300  else{
301  nuParticleIds.push_back(partId);
302  }
303  hBeamTime->Fill(particle.T() * 1e-3);
304  }
305 
306  // If origin is a cosmic ray
307  else if(truth->Origin() == simb::kCosmicRay){
308  crParticleIds.push_back(partId);
309  }
310  }
311 
312  //----------------------------------------------------------------------------------------------------------
313  // FAKE PDS RECONSTRUCTION
314  //----------------------------------------------------------------------------------------------------------
315 
316  // Create fake flashes in each tpc
317  std::pair<std::vector<double>, std::vector<double>> fakeFlashes = CosmicIdUtils::FakeTpcFlashes(parts);
318  std::vector<double> fakeTpc0Flashes = fakeFlashes.first;
319  std::vector<double> fakeTpc1Flashes = fakeFlashes.second;
320  bool tpc0BeamFlash = CosmicIdUtils::BeamFlash(fakeTpc0Flashes, fBeamTimeMin, fBeamTimeMax);
321  bool tpc1BeamFlash = CosmicIdUtils::BeamFlash(fakeTpc1Flashes, fBeamTimeMin, fBeamTimeMax);
322 
323  // If there are no flashes in time with the beam then ignore the event
324  if(!tpc0BeamFlash && !tpc1BeamFlash) return;
325 
326  //----------------------------------------------------------------------------------------------------------
327  // COSMIC ID - CALCULATING CUTS
328  //----------------------------------------------------------------------------------------------------------
329 
330  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(event);
331  auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(event, clockData);
332 
333  //Loop over the pfparticle map
334  for (PFParticleIdMap::const_iterator it = pfParticleMap.begin(); it != pfParticleMap.end(); ++it){
335 
336  const art::Ptr<recob::PFParticle> pParticle(it->second);
337  // Only look for primary particles
338  if (!pParticle->IsPrimary()) continue;
339  // Check if this particle is identified as the neutrino
340  const int pdg(pParticle->PdgCode());
341  const bool isNeutrino(std::abs(pdg) == pandora::NU_E || std::abs(pdg) == pandora::NU_MU || std::abs(pdg) == pandora::NU_TAU);
342  //Find neutrino pfparticle
343  if(!isNeutrino) continue;
344 
345  int pfpType = 3;
346  std::vector<recob::Track> nuTracks;
347 
348  // Loop over daughters of pfparticle
349  for (const size_t daughterId : pParticle->Daughters()){
350 
351  // Get tracks associated with daughter
352  art::Ptr<recob::PFParticle> pDaughter = pfParticleMap.at(daughterId);
353  const std::vector< art::Ptr<recob::Track> > associatedTracks(pfPartToTrackAssoc.at(pDaughter.key()));
354  if(associatedTracks.size() != 1) continue;
355 
356  // Get the first associated track
357  recob::Track tpcTrack = *associatedTracks.front();
358  nuTracks.push_back(tpcTrack);
359 
360  // Truth match muon tracks and pfps
361  std::vector<art::Ptr<recob::Hit>> hits = findManyHits.at(tpcTrack.ID());
362  int trueId = RecoUtils::TrueParticleIDFromTotalRecoHits(clockData, hits, false);
363  int trackType = 3;
364  if(std::find(lepParticleIds.begin(), lepParticleIds.end(), trueId) != lepParticleIds.end()){
365  trackType = 0;
366  pfpType = 0;
367  }
368  else if(std::find(nuParticleIds.begin(), nuParticleIds.end(), trueId) != nuParticleIds.end()){
369  if(pfpType != 0) pfpType = 4;
370  }
371  else if(std::find(dirtParticleIds.begin(), dirtParticleIds.end(), trueId) != dirtParticleIds.end()){
372  trackType = 1;
373  if(pfpType != 0 && pfpType != 4) pfpType = 1;
374  }
375  else if(std::find(crParticleIds.begin(), crParticleIds.end(), trueId) != crParticleIds.end()){
376  trackType = 2;
377  if(pfpType != 0 && pfpType != 4 && pfpType != 1) pfpType = 2;
378  }
379 
380  // Fill cut histograms per track
381  if(particles.find(trueId) != particles.end()){
382  // Only look at muons
383  if(std::abs(particles[trueId].PdgCode()) == 13){
384  // Calculate the true variables
385  std::pair<TVector3, TVector3> se = fTpcGeo.CrossingPoints(particles[trueId]);
386  double momentum = particles[trueId].P();
387  double length = fTpcGeo.TpcLength(particles[trueId]);
388  double theta = (se.second-se.first).Theta();
389  double phi = (se.second-se.first).Phi();
390  // Switch on each cut individually
391  for(size_t j = 0; j < nCuts; j++){
392  bool plot = false;
393  if(j == 0) plot = true;
394  if(j == 1){
395  cosIdAlg.SetCuts(true, false, false, false, false, false, false, false, false);
396  if(cosIdAlg.CosmicId(tpcTrack, event, fakeTpc0Flashes, fakeTpc1Flashes)) plot = true;
397  }
398  if(j == 2){
399  cosIdAlg.SetCuts(false, true, false, false, false, false, false, false, false);
400  if(cosIdAlg.CosmicId(tpcTrack, event, fakeTpc0Flashes, fakeTpc1Flashes)) plot = true;
401  }
402  if(j == 3){
403  cosIdAlg.SetCuts(false, false, true, false, false, false, false, false, false);
404  if(cosIdAlg.CosmicId(tpcTrack, event, fakeTpc0Flashes, fakeTpc1Flashes)) plot = true;
405  }
406  if(j == 4){
407 
408  cosIdAlg.SetCuts(false, false, false, true, false, false, false, false, false);
409  if(cosIdAlg.CosmicId(tpcTrack, event, fakeTpc0Flashes, fakeTpc1Flashes)) plot = true;
410  }
411  if(j == 5){
412  cosIdAlg.SetCuts(false, false, false, false, true, false, false, false, false);
413  if(cosIdAlg.CosmicId(tpcTrack, event, fakeTpc0Flashes, fakeTpc1Flashes)) plot = true;
414  }
415  if(j == 6){
416  cosIdAlg.SetCuts(false, false, false, false, false, true, false, false, false);
417  if(cosIdAlg.CosmicId(tpcTrack, event, fakeTpc0Flashes, fakeTpc1Flashes)) plot = true;
418  }
419  if(j == 7){
420  cosIdAlg.SetCuts(false, false, false, false, false, false, true, false, false);
421  if(cosIdAlg.CosmicId(tpcTrack, event, fakeTpc0Flashes, fakeTpc1Flashes)) plot = true;
422  }
423  if(j == 8){
424  cosIdAlg.SetCuts(false, false, false, false, false, false, false, true, false);
425  if(cosIdAlg.CosmicId(tpcTrack, event, fakeTpc0Flashes, fakeTpc1Flashes)) plot = true;
426  }
427  if(j == 9){
428  cosIdAlg.SetCuts(false, false, false, false, false, false, false, false, true);
429  if(cosIdAlg.CosmicId(tpcTrack, event, fakeTpc0Flashes, fakeTpc1Flashes)) plot = true;
430  }
431  // Return to the cuts specified in the fhicl file
432  if(j == 10){
434  if(cosIdAlg.CosmicId(tpcTrack, event, fakeTpc0Flashes, fakeTpc1Flashes)) plot = true;
435  }
436  if(j == 11 && !cosIdAlg.CosmicId(tpcTrack, event, fakeTpc0Flashes, fakeTpc1Flashes)) plot = true;
437  if(!plot) continue;
438  // Fill histograms if track ID'd as cosmic
439  hTrueMom[trackType][j]->Fill(momentum);
440  hTrueLength[trackType][j]->Fill(length);
441  hTrueTheta[trackType][j]->Fill(theta);
442  hTruePhi[trackType][j]->Fill(phi);
443  }
444  }
445  }
446 
447  }
448 
449  if(nuTracks.size() == 0) continue;
450 
451  // Sort tracks by length
452  std::sort(nuTracks.begin(), nuTracks.end(), [](auto& left, auto& right){
453  return left.Length() > right.Length();});
454 
455  // Choose the longest track as the muon candidate
456  recob::Track nuTrack = nuTracks[0];
457  // Calculate the reconstructed variables
458  double recoMuMomentum = 0.;
459  bool exits = fTpcGeo.InFiducial(nuTrack.End(), 5., 5.);
460  double length = nuTrack.Length();
461  double theta = nuTrack.Theta();
462  double phi = nuTrack.Phi();
463  if(exits){
464  recob::MCSFitResult mcsResult = fMcsFitter.fitMcs(nuTrack);
465  recoMuMomentum = mcsResult.bestMomentum();
466  }
467  else{
468  recoMuMomentum = fRangeFitter.GetTrackMomentum(length, 13);
469  }
470  // Turn on each cut individually
471  for(size_t j = 0; j < nCuts; j++){
472  bool plot = false;
473  if(j == 0) plot = true;
474  if(j == 1){
475  cosIdAlg.SetCuts(true, false, false, false, false, false, false, false, false);
476  if(cosIdAlg.CosmicId(detProp, *pParticle, pfParticleMap, event, fakeTpc0Flashes, fakeTpc1Flashes)){
477  plot = true;
478  }
479  }
480  if(j == 2){
481  cosIdAlg.SetCuts(false, true, false, false, false, false, false, false, false);
482  if(cosIdAlg.CosmicId(detProp, *pParticle, pfParticleMap, event, fakeTpc0Flashes, fakeTpc1Flashes)){
483  plot = true;
484  }
485  }
486  if(j == 3){
487  cosIdAlg.SetCuts(false, false, true, false, false, false, false, false, false);
488  if(cosIdAlg.CosmicId(detProp, *pParticle, pfParticleMap, event, fakeTpc0Flashes, fakeTpc1Flashes)){
489  plot = true;
490  }
491  }
492  if(j == 4){
493  cosIdAlg.SetCuts(false, false, false, true, false, false, false, false, false);
494  if(cosIdAlg.CosmicId(detProp, *pParticle, pfParticleMap, event, fakeTpc0Flashes, fakeTpc1Flashes)){
495  plot = true;
496  }
497  }
498  if(j == 5){
499  cosIdAlg.SetCuts(false, false, false, false, true, false, false, false, false);
500  if(cosIdAlg.CosmicId(detProp, *pParticle, pfParticleMap, event, fakeTpc0Flashes, fakeTpc1Flashes)){
501  plot = true;
502  }
503  }
504  if(j == 6){
505  cosIdAlg.SetCuts(false, false, false, false, false, true, false, false, false);
506  if(cosIdAlg.CosmicId(detProp, *pParticle, pfParticleMap, event, fakeTpc0Flashes, fakeTpc1Flashes)){
507  plot = true;
508  }
509  }
510  if(j == 7){
511  cosIdAlg.SetCuts(false, false, false, false, false, false, true, false, false);
512  if(cosIdAlg.CosmicId(detProp, *pParticle, pfParticleMap, event, fakeTpc0Flashes, fakeTpc1Flashes)){
513  plot = true;
514  }
515  }
516  if(j == 8){
517  cosIdAlg.SetCuts(false, false, false, false, false, false, false, true, false);
518  if(cosIdAlg.CosmicId(detProp, *pParticle, pfParticleMap, event, fakeTpc0Flashes, fakeTpc1Flashes)){
519  plot = true;
520  }
521  }
522  if(j == 9){
523  cosIdAlg.SetCuts(false, false, false, false, false, false, false, false, true);
524  if(cosIdAlg.CosmicId(detProp, *pParticle, pfParticleMap, event, fakeTpc0Flashes, fakeTpc1Flashes)){
525  plot = true;
526  }
527  }
528  // Return to the cuts specified in the fhicl file
529  if(j == 10){
531  if(cosIdAlg.CosmicId(detProp, *pParticle, pfParticleMap, event, fakeTpc0Flashes, fakeTpc1Flashes)) plot = true;
532  }
533  if(j == 11 && !cosIdAlg.CosmicId(detProp, *pParticle, pfParticleMap, event, fakeTpc0Flashes, fakeTpc1Flashes)){
534  plot = true;
535  }
536  if(!plot) continue;
537  //Fill histograms if PFP ID'd as a cosmic
538  hRecoMom[pfpType][j]->Fill(recoMuMomentum);
539  hRecoLength[pfpType][j]->Fill(length);
540  hRecoTheta[pfpType][j]->Fill(theta);
541  hRecoPhi[pfpType][j]->Fill(phi);
542  }
543 
544  }
545 
546  } // CosmicIdAna::analyze()
void GetPFParticleIdMap(const PFParticleHandle &pfParticleHandle, PFParticleIdMap &pfParticleMap)
trkf::TrajectoryMCSFitter fMcsFitter
art::InputTag fTpcTrackModuleLabel
name of TPC track producer
var pdg
Definition: selectors.fcl:14
bool BeamFlash(std::vector< double > flashes, double beamTimeMin, double beamTimeMax)
walls no right
Definition: selectors.fcl:105
bool CosmicId(recob::Track track, const art::Event &event, std::vector< double > t0Tpc0, std::vector< double > t0Tpc1)
process_name plot
TH1D * hRecoLength[5][12]
TH1D * hTrueTheta[4][12]
T abs(T value)
float bestMomentum() const
momentum for best direction fit
Definition: MCSFitResult.h:56
double TpcLength(const simb::MCParticle &particle)
const Cut kCosmicRay
walls no left
Definition: selectors.fcl:105
int TrueParticleIDFromTotalRecoHits(detinfo::DetectorClocksData const &clockData, const std::vector< art::Ptr< recob::Hit > > &hits, bool rollup_unsaved_ids=1)
TH1D * hTrueLength[4][12]
std::map< size_t, art::Ptr< recob::PFParticle > > PFParticleIdMap
trkf::TrackMomentumCalculator fRangeFitter
art::InputTag fSimModuleLabel
name of detsim producer
Class storing the result of the Maximum Likelihood fit of Multiple Coulomb Scattering angles between ...
Definition: MCSFitResult.h:19
art::InputTag fPandoraLabel
art::Handle< std::vector< recob::PFParticle > > PFParticleHandle
TH1D * hRecoTheta[5][12]
do i e
std::pair< std::vector< double >, std::vector< double > > FakeTpcFlashes(std::vector< simb::MCParticle > particles)
Definition: CosmicIdUtils.cc:8
bool fVerbose
print information about what&#39;s going on
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
BEGIN_PROLOG could also be cout
auto const detProp
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a &quot;fitted&quot; track:
double GetTrackMomentum(double trkrange, int pdg) const
std::pair< TVector3, TVector3 > CrossingPoints(const simb::MCParticle &particle)
bool InFiducial(geo::Point_t point, double fiducial)
void SetCuts(bool FV, bool SP, bool Geo, bool CC, bool AC, bool CT, bool CH, bool PT, bool PN)
void sbnd::CosmicIdAna::beginJob ( )
overridevirtual

Definition at line 191 of file CosmicIdAna_module.cc.

192  {
193  // Access tfileservice to handle creating and writing histograms
194  art::ServiceHandle<art::TFileService> tfs;
195 
196  hBeamTime = tfs->make<TH1D>("BeamTime", "", 100, -10, 10);
197 
198  for(size_t i = 0; i < nTC; i++){
199  for(size_t j = 0; j < nCuts; j++){
200  TString hMom_name = Form("hTrueMom%s_%s", trueCategories[i].c_str(), cuts[j].c_str());
201  hTrueMom[i][j] = tfs->make<TH1D>(hMom_name, "", 20, 0, 2);
202  TString hLength_name = Form("hTrueLength%s_%s", trueCategories[i].c_str(), cuts[j].c_str());
203  hTrueLength[i][j] = tfs->make<TH1D>(hLength_name, "", 20, 0, 500);
204  TString hTheta_name = Form("hTrueTheta%s_%s", trueCategories[i].c_str(), cuts[j].c_str());
205  hTrueTheta[i][j] = tfs->make<TH1D>(hTheta_name, "", 20, 0, 3.2);
206  TString hPhi_name = Form("hTruePhi%s_%s", trueCategories[i].c_str(), cuts[j].c_str());
207  hTruePhi[i][j] = tfs->make<TH1D>(hPhi_name, "", 20, -3.2, 3.2);
208  }
209  }
210 
211  for(size_t i = 0; i < nRC; i++){
212  for(size_t j = 0; j < nCuts; j++){
213  TString hMom_name = Form("hRecoMom%s_%s", recoCategories[i].c_str(), cuts[j].c_str());
214  hRecoMom[i][j] = tfs->make<TH1D>(hMom_name, "", 20, 0, 2);
215  TString hLength_name = Form("hRecoLength%s_%s", recoCategories[i].c_str(), cuts[j].c_str());
216  hRecoLength[i][j] = tfs->make<TH1D>(hLength_name, "", 20, 0, 500);
217  TString hTheta_name = Form("hRecoTheta%s_%s", recoCategories[i].c_str(), cuts[j].c_str());
218  hRecoTheta[i][j] = tfs->make<TH1D>(hTheta_name, "", 20, 0, 3.2);
219  TString hPhi_name = Form("hRecoPhi%s_%s", recoCategories[i].c_str(), cuts[j].c_str());
220  hRecoPhi[i][j] = tfs->make<TH1D>(hPhi_name, "", 20, -3.2, 3.2);
221  }
222  }
223 
224  // Initial output
225  if(fVerbose) std::cout<<"----------------- Cosmic ID Ana Module -------------------"<<std::endl;
226 
227  }// CosmicIdAna::beginJob()
std::vector< std::string > recoCategories
TH1D * hRecoLength[5][12]
TH1D * hTrueTheta[4][12]
std::vector< std::string > cuts
TH1D * hTrueLength[4][12]
TH1D * hRecoTheta[5][12]
bool fVerbose
print information about what&#39;s going on
art::ServiceHandle< art::TFileService > tfs
std::vector< std::string > trueCategories
BEGIN_PROLOG could also be cout
void sbnd::CosmicIdAna::endJob ( )
overridevirtual

Definition at line 549 of file CosmicIdAna_module.cc.

549  {
550 
551  } // CosmicIdAna::endJob()
void sbnd::CosmicIdAna::GetPFParticleIdMap ( const PFParticleHandle pfParticleHandle,
PFParticleIdMap pfParticleMap 
)
private

Definition at line 553 of file CosmicIdAna_module.cc.

553  {
554  for (unsigned int i = 0; i < pfParticleHandle->size(); ++i){
555  const art::Ptr<recob::PFParticle> pParticle(pfParticleHandle, i);
556  if (!pfParticleMap.insert(PFParticleIdMap::value_type(pParticle->Self(), pParticle)).second){
557  std::cout << " Unable to get PFParticle ID map, the input PFParticle collection has repeat IDs!" <<"\n";
558  }
559  }
560  }
BEGIN_PROLOG could also be cout

Member Data Documentation

CosmicIdAlg sbnd::CosmicIdAna::cosIdAlg
private

Definition at line 142 of file CosmicIdAna_module.cc.

std::vector<std::string> sbnd::CosmicIdAna::cuts {"None","FV","SP","Geo","CC","AC","CT","CH","PT","PN","Tot","Remain"}
private

Definition at line 153 of file CosmicIdAna_module.cc.

double sbnd::CosmicIdAna::fBeamTimeMax
private

Definition at line 140 of file CosmicIdAna_module.cc.

double sbnd::CosmicIdAna::fBeamTimeMin
private

Definition at line 139 of file CosmicIdAna_module.cc.

trkf::TrajectoryMCSFitter sbnd::CosmicIdAna::fMcsFitter
private

Definition at line 145 of file CosmicIdAna_module.cc.

art::InputTag sbnd::CosmicIdAna::fPandoraLabel
private

Definition at line 137 of file CosmicIdAna_module.cc.

trkf::TrackMomentumCalculator sbnd::CosmicIdAna::fRangeFitter
private

Definition at line 146 of file CosmicIdAna_module.cc.

art::InputTag sbnd::CosmicIdAna::fSimModuleLabel
private

name of detsim producer

Definition at line 135 of file CosmicIdAna_module.cc.

TPCGeoAlg sbnd::CosmicIdAna::fTpcGeo
private

Definition at line 143 of file CosmicIdAna_module.cc.

art::InputTag sbnd::CosmicIdAna::fTpcTrackModuleLabel
private

name of TPC track producer

Definition at line 136 of file CosmicIdAna_module.cc.

bool sbnd::CosmicIdAna::fVerbose
private

print information about what's going on

Definition at line 138 of file CosmicIdAna_module.cc.

TH1D* sbnd::CosmicIdAna::hBeamTime
private

Definition at line 156 of file CosmicIdAna_module.cc.

TH1D* sbnd::CosmicIdAna::hRecoLength[5][12]
private

Definition at line 164 of file CosmicIdAna_module.cc.

TH1D* sbnd::CosmicIdAna::hRecoMom[5][12]
private

Definition at line 163 of file CosmicIdAna_module.cc.

TH1D* sbnd::CosmicIdAna::hRecoPhi[5][12]
private

Definition at line 166 of file CosmicIdAna_module.cc.

TH1D* sbnd::CosmicIdAna::hRecoTheta[5][12]
private

Definition at line 165 of file CosmicIdAna_module.cc.

TH1D* sbnd::CosmicIdAna::hTrueLength[4][12]
private

Definition at line 159 of file CosmicIdAna_module.cc.

TH1D* sbnd::CosmicIdAna::hTrueMom[4][12]
private

Definition at line 158 of file CosmicIdAna_module.cc.

TH1D* sbnd::CosmicIdAna::hTruePhi[4][12]
private

Definition at line 161 of file CosmicIdAna_module.cc.

TH1D* sbnd::CosmicIdAna::hTrueTheta[4][12]
private

Definition at line 160 of file CosmicIdAna_module.cc.

size_t sbnd::CosmicIdAna::nCuts = cuts.size()
private

Definition at line 154 of file CosmicIdAna_module.cc.

size_t sbnd::CosmicIdAna::nRC = recoCategories.size()
private

Definition at line 152 of file CosmicIdAna_module.cc.

size_t sbnd::CosmicIdAna::nTC = trueCategories.size()
private

Definition at line 150 of file CosmicIdAna_module.cc.

std::vector<std::string> sbnd::CosmicIdAna::recoCategories {"NuMu","Dirt","Cr","Other","OtherNu"}
private

Definition at line 151 of file CosmicIdAna_module.cc.

std::vector<std::string> sbnd::CosmicIdAna::trueCategories {"NuMu","Dirt","Cr","Other"}
private

Definition at line 149 of file CosmicIdAna_module.cc.


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