CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
TrackerHitAssociator::Config Struct Reference

#include <TrackerHitAssociator.h>

Public Member Functions

 Config ()
 
 Config (const edm::ParameterSet &conf, edm::ConsumesCollector &&iC)
 
 Config (edm::ConsumesCollector &&iC)
 

Public Attributes

bool assocHitbySimTrack_
 
std::vector< edm::EDGetTokenT< CrossingFrame< PSimHit > > > cfTokens_
 
bool doPixel_
 
bool doStrip_
 
bool doTrackAssoc_
 
edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > ph2OTrToken_
 
edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > pixelToken_
 
std::vector< edm::EDGetTokenT< std::vector< PSimHit > > > simHitTokens_
 
edm::EDGetTokenT< edm::DetSetVector< StripDigiSimLink > > stripToken_
 
bool useOTph2_
 

Detailed Description

Definition at line 55 of file TrackerHitAssociator.h.

Constructor & Destructor Documentation

◆ Config() [1/3]

TrackerHitAssociator::Config::Config ( )
inline

Definition at line 56 of file TrackerHitAssociator.h.

56 {}

◆ Config() [2/3]

TrackerHitAssociator::Config::Config ( const edm::ParameterSet conf,
edm::ConsumesCollector &&  iC 
)

Definition at line 70 of file TrackerHitAssociator.cc.

References cfTokens_, doPixel_, doStrip_, doTrackAssoc_, edm::ParameterSet::getParameter(), ph2OTrToken_, pixelToken_, simHitTokens_, stripToken_, and useOTph2_.

71  : doPixel_(conf.getParameter<bool>("associatePixel")),
72  doStrip_(conf.getParameter<bool>("associateStrip")),
73  useOTph2_(conf.existsAs<bool>("usePhase2Tracker") ? conf.getParameter<bool>("usePhase2Tracker") : false),
74  //
75  doTrackAssoc_(conf.getParameter<bool>("associateRecoTracks")),
77  conf.existsAs<bool>("associateHitbySimTrack") ? conf.getParameter<bool>("associateHitbySimTrack") : false) {
78  if (doStrip_) {
79  if (useOTph2_)
80  ph2OTrToken_ =
81  iC.consumes<edm::DetSetVector<PixelDigiSimLink>>(conf.getParameter<edm::InputTag>("phase2TrackerSimLinkSrc"));
82  else
83  stripToken_ =
85  }
86  if (doPixel_)
88  if (!doTrackAssoc_) {
89  std::vector<std::string> trackerContainers(conf.getParameter<std::vector<std::string>>("ROUList"));
90  cfTokens_.reserve(trackerContainers.size());
91  simHitTokens_.reserve(trackerContainers.size());
92  for (auto const& trackerContainer : trackerContainers) {
93  cfTokens_.push_back(iC.consumes<CrossingFrame<PSimHit>>(edm::InputTag("mix", trackerContainer)));
94  simHitTokens_.push_back(iC.consumes<std::vector<PSimHit>>(edm::InputTag("g4SimHits", trackerContainer)));
95  }
96  }
97 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::vector< edm::EDGetTokenT< CrossingFrame< PSimHit > > > cfTokens_
edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > ph2OTrToken_
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:172
edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > pixelToken_
edm::EDGetTokenT< edm::DetSetVector< StripDigiSimLink > > stripToken_
std::vector< edm::EDGetTokenT< std::vector< PSimHit > > > simHitTokens_

◆ Config() [3/3]

TrackerHitAssociator::Config::Config ( edm::ConsumesCollector &&  iC)

Definition at line 29 of file TrackerHitAssociator.cc.

References cfTokens_, doPixel_, doStrip_, doTrackAssoc_, ProducerED_cfi::InputTag, ph2OTrToken_, pixelToken_, edm::DetSetVector< T >::reserve(), simHitTokens_, stripToken_, and useOTph2_.

30  : doPixel_(true), doStrip_(true), useOTph2_(false), doTrackAssoc_(false), assocHitbySimTrack_(false) {
31  if (doStrip_) {
32  if (useOTph2_)
33  ph2OTrToken_ = iC.consumes<edm::DetSetVector<PixelDigiSimLink>>(edm::InputTag("simSiPixelDigis", "Tracker"));
34  else
36  }
37  if (doPixel_) {
38  if (useOTph2_)
39  pixelToken_ = iC.consumes<edm::DetSetVector<PixelDigiSimLink>>(edm::InputTag("simSiPixelDigis", "Pixel"));
40  else
42  }
43  if (!doTrackAssoc_) {
44  std::vector<std::string> trackerContainers;
45  trackerContainers.reserve(12);
46  trackerContainers.emplace_back("g4SimHitsTrackerHitsTIBLowTof");
47  trackerContainers.emplace_back("g4SimHitsTrackerHitsTIBHighTof");
48  trackerContainers.emplace_back("g4SimHitsTrackerHitsTIDLowTof");
49  trackerContainers.emplace_back("g4SimHitsTrackerHitsTIDHighTof");
50  trackerContainers.emplace_back("g4SimHitsTrackerHitsTOBLowTof");
51  trackerContainers.emplace_back("g4SimHitsTrackerHitsTOBHighTof");
52  trackerContainers.emplace_back("g4SimHitsTrackerHitsTECLowTof");
53  trackerContainers.emplace_back("g4SimHitsTrackerHitsTECHighTof");
54  trackerContainers.emplace_back("g4SimHitsTrackerHitsPixelBarrelLowTof");
55  trackerContainers.emplace_back("g4SimHitsTrackerHitsPixelBarrelHighTof");
56  trackerContainers.emplace_back("g4SimHitsTrackerHitsPixelEndcapLowTof");
57  trackerContainers.emplace_back("g4SimHitsTrackerHitsPixelEndcapHighTof");
58  cfTokens_.reserve(trackerContainers.size());
59  simHitTokens_.reserve(trackerContainers.size());
60  for (auto const& trackerContainer : trackerContainers) {
61  cfTokens_.push_back(iC.consumes<CrossingFrame<PSimHit>>(edm::InputTag("mix", trackerContainer)));
62  simHitTokens_.push_back(iC.consumes<std::vector<PSimHit>>(edm::InputTag("g4SimHits", trackerContainer)));
63  }
64  }
65 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::vector< edm::EDGetTokenT< CrossingFrame< PSimHit > > > cfTokens_
void reserve(size_t s)
Definition: DetSetVector.h:145
edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > ph2OTrToken_
edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > pixelToken_
edm::EDGetTokenT< edm::DetSetVector< StripDigiSimLink > > stripToken_
std::vector< edm::EDGetTokenT< std::vector< PSimHit > > > simHitTokens_

Member Data Documentation

◆ assocHitbySimTrack_

bool TrackerHitAssociator::Config::assocHitbySimTrack_

Definition at line 59 of file TrackerHitAssociator.h.

◆ cfTokens_

std::vector<edm::EDGetTokenT<CrossingFrame<PSimHit> > > TrackerHitAssociator::Config::cfTokens_

Definition at line 62 of file TrackerHitAssociator.h.

Referenced by Config().

◆ doPixel_

bool TrackerHitAssociator::Config::doPixel_

Definition at line 59 of file TrackerHitAssociator.h.

Referenced by Config().

◆ doStrip_

bool TrackerHitAssociator::Config::doStrip_

Definition at line 59 of file TrackerHitAssociator.h.

Referenced by Config().

◆ doTrackAssoc_

bool TrackerHitAssociator::Config::doTrackAssoc_

Definition at line 59 of file TrackerHitAssociator.h.

Referenced by Config().

◆ ph2OTrToken_

edm::EDGetTokenT<edm::DetSetVector<PixelDigiSimLink> > TrackerHitAssociator::Config::ph2OTrToken_

Definition at line 61 of file TrackerHitAssociator.h.

Referenced by Config().

◆ pixelToken_

edm::EDGetTokenT<edm::DetSetVector<PixelDigiSimLink> > TrackerHitAssociator::Config::pixelToken_

Definition at line 61 of file TrackerHitAssociator.h.

Referenced by Config().

◆ simHitTokens_

std::vector<edm::EDGetTokenT<std::vector<PSimHit> > > TrackerHitAssociator::Config::simHitTokens_

Definition at line 63 of file TrackerHitAssociator.h.

Referenced by Config().

◆ stripToken_

edm::EDGetTokenT<edm::DetSetVector<StripDigiSimLink> > TrackerHitAssociator::Config::stripToken_

Definition at line 60 of file TrackerHitAssociator.h.

Referenced by Config().

◆ useOTph2_

bool TrackerHitAssociator::Config::useOTph2_

Definition at line 59 of file TrackerHitAssociator.h.

Referenced by Config().