CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
TrackerHitProducer Class Reference

#include <TrackerHitProducer.h>

Inheritance diagram for TrackerHitProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Types

typedef std::vector< float > FloatVector
 
typedef std::vector< int > IntegerVector
 
- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 

Public Member Functions

virtual void beginJob ()
 
virtual void endJob ()
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 TrackerHitProducer (const edm::ParameterSet &)
 
virtual ~TrackerHitProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

void clear ()
 
void fillG4MC (edm::Event &)
 
void fillTrk (edm::Event &, const edm::EventSetup &)
 
void storeG4MC (PTrackerSimHit &)
 
void storeTrk (PTrackerSimHit &)
 

Private Attributes

edm::ParameterSet config_
 
unsigned int count
 
std::string fName
 
FloatVector G4TrkE
 
FloatVector G4TrkEta
 
FloatVector G4TrkPhi
 
FloatVector G4TrkPt
 
edm::InputTag G4TrkSrc_
 
edm::InputTag G4VtxSrc_
 
FloatVector G4VtxX
 
FloatVector G4VtxY
 
FloatVector G4VtxZ
 
bool getAllProvenances
 
FloatVector HitsDuID
 
FloatVector HitsEloss
 
FloatVector HitsEnPx
 
FloatVector HitsEnPy
 
FloatVector HitsEnPz
 
FloatVector HitsExPx
 
FloatVector HitsExPy
 
FloatVector HitsExPz
 
FloatVector HitsLdPhi
 
FloatVector HitsLdTheta
 
FloatVector HitsLdX
 
FloatVector HitsLdY
 
FloatVector HitsLdZ
 
FloatVector HitsLpX
 
FloatVector HitsLpY
 
FloatVector HitsLpZ
 
FloatVector HitsP
 
FloatVector HitsParT
 
FloatVector HitsProT
 
IntegerVector HitsSysID
 
FloatVector HitsTkID
 
FloatVector HitsToF
 
std::string label
 
int nRawGenPart
 
bool printProvenanceInfo
 
edm::InputTag PxlBrlHighSrc_
 
edm::InputTag PxlBrlLowSrc_
 
edm::InputTag PxlFwdHighSrc_
 
edm::InputTag PxlFwdLowSrc_
 
edm::InputTag SiTECHighSrc_
 
edm::InputTag SiTECLowSrc_
 
edm::InputTag SiTIBHighSrc_
 
edm::InputTag SiTIBLowSrc_
 
edm::InputTag SiTIDHighSrc_
 
edm::InputTag SiTIDLowSrc_
 
edm::InputTag SiTOBHighSrc_
 
edm::InputTag SiTOBLowSrc_
 
int verbosity
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 52 of file TrackerHitProducer.h.

Member Typedef Documentation

typedef std::vector<float> TrackerHitProducer::FloatVector

Definition at line 57 of file TrackerHitProducer.h.

typedef std::vector<int> TrackerHitProducer::IntegerVector

Definition at line 58 of file TrackerHitProducer.h.

Constructor & Destructor Documentation

TrackerHitProducer::TrackerHitProducer ( const edm::ParameterSet iPSet)
explicit

Definition at line 4 of file TrackerHitProducer.cc.

References fName, getAllProvenances, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), edm::InputTag::instance(), edm::InputTag::label(), label, printProvenanceInfo, PxlBrlHighSrc_, PxlBrlLowSrc_, PxlFwdHighSrc_, PxlFwdLowSrc_, SiTECHighSrc_, SiTECLowSrc_, SiTIBHighSrc_, SiTIBLowSrc_, SiTIDHighSrc_, SiTIDLowSrc_, SiTOBHighSrc_, SiTOBLowSrc_, AlCaHLTBitMon_QueryRunRegistry::string, and verbosity.

4  :
5  fName(""), verbosity(0), label(""), getAllProvenances(false),
7  G4VtxSrc_(iPSet.getParameter<edm::InputTag>("G4VtxSrc")),
8  G4TrkSrc_(iPSet.getParameter<edm::InputTag>("G4TrkSrc")),
9  config_(iPSet), count(0)
10 {
11  // get information from parameter set
12  fName = iPSet.getUntrackedParameter<std::string>("Name");
13  verbosity = iPSet.getUntrackedParameter<int>("Verbosity");
14  label = iPSet.getParameter<std::string>("Label");
15  edm::ParameterSet m_Prov =
16  iPSet.getParameter<edm::ParameterSet>("ProvenanceLookup");
18  m_Prov.getUntrackedParameter<bool>("GetAllProvenances");
20  m_Prov.getUntrackedParameter<bool>("PrintProvenanceInfo");
21 
22  //get Labels to use to extract information
23  PxlBrlLowSrc_ = iPSet.getParameter<edm::InputTag>("PxlBrlLowSrc");
24  PxlBrlHighSrc_ = iPSet.getParameter<edm::InputTag>("PxlBrlHighSrc");
25  PxlFwdLowSrc_ = iPSet.getParameter<edm::InputTag>("PxlFwdLowSrc");
26  PxlFwdHighSrc_ = iPSet.getParameter<edm::InputTag>("PxlFwdHighSrc");
27 
28  SiTIBLowSrc_ = iPSet.getParameter<edm::InputTag>("SiTIBLowSrc");
29  SiTIBHighSrc_ = iPSet.getParameter<edm::InputTag>("SiTIBHighSrc");
30  SiTOBLowSrc_ = iPSet.getParameter<edm::InputTag>("SiTOBLowSrc");
31  SiTOBHighSrc_ = iPSet.getParameter<edm::InputTag>("SiTOBHighSrc");
32  SiTIDLowSrc_ = iPSet.getParameter<edm::InputTag>("SiTIDLowSrc");
33  SiTIDHighSrc_ = iPSet.getParameter<edm::InputTag>("SiTIDHighSrc");
34  SiTECLowSrc_ = iPSet.getParameter<edm::InputTag>("SiTECLowSrc");
35  SiTECHighSrc_ = iPSet.getParameter<edm::InputTag>("SiTECHighSrc");
36 
37  // use value of first digit to determine default output level (inclusive)
38  // 0 is none, 1 is basic, 2 is fill output, 3 is gather output
39  verbosity %= 10;
40 
41  // create persistent object
42  produces<PTrackerSimHit>(label);
43 
44  // print out Parameter Set information being used
45  if (verbosity > 0) {
46  edm::LogInfo ("TrackerHitProducer::TrackerHitProducer")
47  << "\n===============================\n"
48  << "Initialized as EDProducer with parameter values:\n"
49  << " Name =" << fName << "\n"
50  << " Verbosity =" << verbosity << "\n"
51  << " Label =" << label << "\n"
52  << " GetProv =" << getAllProvenances << "\n"
53  << " PrintProv =" << printProvenanceInfo << "\n"
54  << " PxlBrlLowSrc = " << PxlBrlLowSrc_.label()
55  << ":" << PxlBrlLowSrc_.instance() << "\n"
56  << " PxlBrlHighSrc = " << PxlBrlHighSrc_.label()
57  << ":" << PxlBrlHighSrc_.instance() << "\n"
58  << " PxlFwdLowSrc = " << PxlFwdLowSrc_.label()
59  << ":" << PxlBrlLowSrc_.instance() << "\n"
60  << " PxlFwdHighSrc = " << PxlFwdHighSrc_.label()
61  << ":" << PxlBrlHighSrc_.instance() << "\n"
62  << " SiTIBLowSrc = " << SiTIBLowSrc_.label()
63  << ":" << SiTIBLowSrc_.instance() << "\n"
64  << " SiTIBHighSrc = " << SiTIBHighSrc_.label()
65  << ":" << SiTIBHighSrc_.instance() << "\n"
66  << " SiTOBLowSrc = " << SiTOBLowSrc_.label()
67  << ":" << SiTOBLowSrc_.instance() << "\n"
68  << " SiTOBHighSrc = " << SiTOBHighSrc_.label()
69  << ":" << SiTOBHighSrc_.instance() << "\n"
70  << " SiTIDLowSrc = " << SiTIDLowSrc_.label()
71  << ":" << SiTIDLowSrc_.instance() << "\n"
72  << " SiTIDHighSrc = " << SiTIDHighSrc_.label()
73  << ":" << SiTIDHighSrc_.instance() << "\n"
74  << " SiTECLowSrc = " << SiTECLowSrc_.label()
75  << ":" << SiTECLowSrc_.instance() << "\n"
76  << " SiTECHighSrc = " << SiTECHighSrc_.label()
77  << ":" << SiTECHighSrc_.instance() << "\n"
78  << "===============================\n"; }
79 }
T getParameter(std::string const &) const
edm::InputTag SiTIBHighSrc_
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag PxlFwdHighSrc_
edm::InputTag PxlBrlHighSrc_
edm::InputTag SiTIDHighSrc_
edm::InputTag PxlFwdLowSrc_
edm::InputTag SiTOBLowSrc_
edm::InputTag SiTECHighSrc_
edm::InputTag PxlBrlLowSrc_
edm::InputTag SiTECLowSrc_
std::string const & label() const
Definition: InputTag.h:42
edm::ParameterSet config_
std::string const & instance() const
Definition: InputTag.h:43
edm::InputTag SiTIDLowSrc_
edm::InputTag SiTOBHighSrc_
edm::InputTag SiTIBLowSrc_
TrackerHitProducer::~TrackerHitProducer ( )
virtual

Definition at line 81 of file TrackerHitProducer.cc.

82 {
83 }

Member Function Documentation

void TrackerHitProducer::beginJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 85 of file TrackerHitProducer.cc.

References clear(), and verbosity.

86 {
87  if (verbosity > 0)
88  edm::LogInfo ("TrackerHitProducer::beginJob")
89  << "Starting the job...";
90  clear();
91  return;
92 }
void TrackerHitProducer::clear ( void  )
private

Definition at line 1067 of file TrackerHitProducer.cc.

References G4TrkE, G4TrkEta, G4TrkPhi, G4TrkPt, G4VtxX, G4VtxY, G4VtxZ, HitsDuID, HitsEloss, HitsEnPx, HitsEnPy, HitsEnPz, HitsExPx, HitsExPy, HitsExPz, HitsLdPhi, HitsLdTheta, HitsLdX, HitsLdY, HitsLdZ, HitsLpX, HitsLpY, HitsLpZ, HitsP, HitsParT, HitsProT, HitsSysID, HitsTkID, HitsToF, nRawGenPart, and verbosity.

Referenced by beginJob(), and produce().

1068 {
1069  if (verbosity > 0)
1070  edm::LogInfo("GlobalValProducer::clear")
1071  << "Clearing event holders";
1072 
1073  // reset G4MC info
1074  nRawGenPart = 0;
1075  G4VtxX.clear();
1076  G4VtxY.clear();
1077  G4VtxZ.clear();
1078  G4TrkPt.clear();
1079  G4TrkE.clear();
1080  G4TrkEta.clear();
1081  G4TrkPhi.clear();
1082  // reset tracker info
1083  HitsSysID.clear();
1084  HitsDuID.clear();
1085  HitsTkID.clear();
1086  HitsProT.clear();
1087  HitsParT.clear();
1088  HitsP.clear();
1089  HitsLpX.clear();
1090  HitsLpY.clear();
1091  HitsLpZ.clear();
1092  HitsLdX.clear();
1093  HitsLdY.clear();
1094  HitsLdZ.clear();
1095  HitsLdTheta.clear();
1096  HitsLdPhi.clear();
1097  HitsExPx.clear();
1098  HitsExPy.clear();
1099  HitsExPz.clear();
1100  HitsEnPx.clear();
1101  HitsEnPy.clear();
1102  HitsEnPz.clear();
1103  HitsEloss.clear();
1104  HitsToF.clear();
1105 
1106  return;
1107 }
void TrackerHitProducer::endJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 94 of file TrackerHitProducer.cc.

References count, and verbosity.

95 {
96  if (verbosity > 0)
97  edm::LogInfo ("TrackerHitProducer::endJob")
98  << "Terminating having processed" << count << "events.";
99  return;
100 }
void TrackerHitProducer::fillG4MC ( edm::Event iEvent)
private

Definition at line 187 of file TrackerHitProducer.cc.

References config_, G4TrkE, G4TrkEta, G4TrkPhi, G4TrkPt, G4TrkSrc_, G4VtxSrc_, G4VtxX, G4VtxY, G4VtxZ, edm::Event::getByLabel(), edm::ParameterSet::getUntrackedParameter(), i, edm::HandleBase::isValid(), create_public_lumi_plots::log, siStripFEDMonitor_P5_cff::Max, siStripFEDMonitor_P5_cff::Min, nRawGenPart, mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, funct::tan(), theta(), and verbosity.

Referenced by produce().

188 {
189 
190  TString eventout;
191  if (verbosity > 0)
192  eventout = "\nGathering info:";
193 
195  // get MC information
198  static std::string HepMClabel = config_.getUntrackedParameter<std::string>("HepMCProductLabel","source");
199  static std::string HepMCinstance = config_.getUntrackedParameter<std::string>("HepMCInputInstance","");
200  iEvent.getByLabel(HepMClabel, HepMCinstance ,HepMCEvt);
201  if (!HepMCEvt.isValid()) {
202  edm::LogError("TrackerHitProducer::fillG4MC")
203  << "Unable to find HepMCProduct in event!";
204  return;
205  }
206  const HepMC::GenEvent* MCEvt = HepMCEvt->GetEvent();
207  nRawGenPart = MCEvt->particles_size();
208 
209  if (verbosity > 1) {
210  eventout += "\n Number of Raw Particles collected: ";
211  eventout += nRawGenPart;
212  }
213 
215  // get G4Vertex information
218  iEvent.getByLabel(G4VtxSrc_, G4VtxContainer);
219  if (!G4VtxContainer.isValid()) {
220  edm::LogError("TrackerHitProducer::fillG4MC")
221  << "Unable to find SimVertex in event!";
222  return;
223  }
224  int i = 0;
225  edm::SimVertexContainer::const_iterator itVtx;
226  for (itVtx = G4VtxContainer->begin(); itVtx != G4VtxContainer->end();
227  ++itVtx) {
228 
229  ++i;
230 
231  const CLHEP::HepLorentzVector& G4Vtx = CLHEP::HepLorentzVector(itVtx->position().x(),
232  itVtx->position().y(),
233  itVtx->position().z(),
234  itVtx->position().e());
235  G4VtxX.push_back(G4Vtx[0]/micrometer); //cm from code -> micrometer *10000
236  G4VtxY.push_back(G4Vtx[1]/micrometer); //cm from code -> micrometer *10000
237  G4VtxZ.push_back(G4Vtx[2]/millimeter); //cm from code -> millimeter *10
238  }
239 
240  if (verbosity > 1) {
241  eventout += "\n Number of G4Vertices collected: ";
242  eventout += i;
243  }
244 
246  // get G4Track information
249  iEvent.getByLabel(G4TrkSrc_, G4TrkContainer);
250  if (!G4TrkContainer.isValid()) {
251  edm::LogError("TrackerHitProducer::fillG4MC")
252  << "Unable to find SimTrack in event!";
253  return;
254  }
255  i = 0;
256  edm::SimTrackContainer::const_iterator itTrk;
257  for (itTrk = G4TrkContainer->begin(); itTrk != G4TrkContainer->end();
258  ++itTrk) {
259 
260  ++i;
261 
262  double etaInit =0, phiInit =0, pInit =0;
263  const CLHEP::HepLorentzVector& G4Trk = CLHEP::HepLorentzVector(itTrk->momentum().x(),
264  itTrk->momentum().y(),
265  itTrk->momentum().z(),
266  itTrk->momentum().e());
267  pInit =sqrt(G4Trk[0]*G4Trk[0]+G4Trk[1]*G4Trk[1]+G4Trk[2]*G4Trk[2]);
268  if ( pInit == 0)
269  edm::LogError("TrackerHitProducer::fillG4MC")
270  << "TrackerTest::INFO: Primary has p = 0 ";
271  else {
272  double costheta = G4Trk[2]/pInit;
273  double theta = acos(TMath::Min(TMath::Max(costheta, -1.),1.));
274  etaInit = -log(tan(theta/2));
275 
276  if ( G4Trk[0] != 0 || G4Trk[1] != 0)
277  phiInit = atan2(G4Trk[1],G4Trk[0]);
278  }
279  G4TrkPt.push_back(sqrt(G4Trk[0]*G4Trk[0]+G4Trk[1]*G4Trk[1])); //GeV
280  G4TrkE.push_back(G4Trk[3]); //GeV
281  G4TrkEta.push_back(etaInit);
282  G4TrkPhi.push_back(phiInit);
283  }
284 
285  if (verbosity > 1) {
286  eventout += "\n Number of G4Tracks collected: ";
287  eventout += i;
288  }
289 
290  if (verbosity > 0)
291  edm::LogInfo("TrackerHitProducer::fillG4MC") << eventout;
292 
293  return;
294 }
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
Geom::Theta< T > theta() const
T sqrt(T t)
Definition: SSEVec.h:48
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
edm::ParameterSet config_
void TrackerHitProducer::fillTrk ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
private

Definition at line 336 of file TrackerHitProducer.cc.

References edm::Event::getByLabel(), HitsDuID, HitsEloss, HitsEnPx, HitsEnPy, HitsEnPz, HitsExPx, HitsExPy, HitsExPz, HitsLdPhi, HitsLdTheta, HitsLdX, HitsLdY, HitsLdZ, HitsLpX, HitsLpY, HitsLpZ, HitsP, HitsParT, HitsProT, HitsSysID, HitsTkID, HitsToF, edm::HandleBase::isValid(), j, PxlBrlHighSrc_, PxlBrlLowSrc_, PxlFwdHighSrc_, PxlFwdLowSrc_, SiTECHighSrc_, SiTECLowSrc_, SiTIBHighSrc_, SiTIBLowSrc_, SiTIDHighSrc_, SiTIDLowSrc_, SiTOBHighSrc_, SiTOBLowSrc_, and verbosity.

Referenced by produce().

338 {
339  TString eventout;
340  int sysID = 0;
341  if (verbosity > 0)
342  eventout = "\nGathering info:";
344  // iterator to access containers
345  edm::PSimHitContainer::const_iterator itHit;
346 // edm::PSimHitContainer theHits;
347 
349  // get Pixel Barrel information
351 
352  // extract low container
353  edm::Handle<edm::PSimHitContainer> PxlBrlLowContainer;
354  iEvent.getByLabel(PxlBrlLowSrc_,PxlBrlLowContainer);
355 // iEvent.getByLabel("g4SimHits","TrackerHitsPixelBarrelLowTof",PxlBrlLowContainer);
356  if (!PxlBrlLowContainer.isValid()) {
357  edm::LogError("TrackerHitProducer::fillTrk")
358  << "Unable to find TrackerHitsPixelBarrelLowTof in event!";
359  return;
360  }
361 
362  // place both containers into new container
363 // theHits.insert(theHits.end(),PxlBrlLowContainer->begin(),
364 // PxlBrlLowContainer->end());
365 
366  sysID = 100; // TrackerHitsPixelBarrelLowTof
367  int j = 0;
368  for (itHit = PxlBrlLowContainer->begin(); itHit != PxlBrlLowContainer->end(); ++itHit) {
369 // for (itHit = theHits.begin(); itHit != theHits.end(); ++itHit) {
370 
371  // gather necessary information
372  ++j;
373  HitsSysID.push_back(sysID);
374  HitsDuID.push_back(itHit->detUnitId());
375  HitsTkID.push_back(itHit->trackId());
376  HitsProT.push_back(itHit->processType());
377  HitsParT.push_back(itHit->particleType());
378  HitsP.push_back(itHit->pabs());
379 
380  HitsLpX.push_back(itHit->localPosition().x());
381  HitsLpY.push_back(itHit->localPosition().y());
382  HitsLpZ.push_back(itHit->localPosition().z());
383 
384  HitsLdX.push_back(itHit->localDirection().x());
385  HitsLdY.push_back(itHit->localDirection().y());
386  HitsLdZ.push_back(itHit->localDirection().z());
387  HitsLdTheta.push_back(itHit->localDirection().theta());
388  HitsLdPhi.push_back(itHit->localDirection().phi());
389 
390  HitsExPx.push_back(itHit->exitPoint().x());
391  HitsExPy.push_back(itHit->exitPoint().y());
392  HitsExPz.push_back(itHit->exitPoint().z());
393 
394  HitsEnPx.push_back(itHit->entryPoint().x());
395  HitsEnPy.push_back(itHit->entryPoint().y());
396  HitsEnPz.push_back(itHit->entryPoint().z());
397 
398  HitsEloss.push_back(itHit->energyLoss());
399  HitsToF.push_back(itHit->tof());
400 
401  } // end loop through PxlBrl Hits
402 
403  if (verbosity > 1) {
404  eventout += "\n Number of Pixel Barrel Low TOF Hits collected: ";
405  eventout += j;
406  }
407 
408 // theHits.clear();
409 
410  // extract high container
411  edm::Handle<edm::PSimHitContainer> PxlBrlHighContainer;
412 // iEvent.getByLabel("g4SimHits","TrackerHitsPixelBarrelHighTof",PxlBrlHighContainer);
413  iEvent.getByLabel(PxlBrlHighSrc_,PxlBrlHighContainer);
414  if (!PxlBrlHighContainer.isValid()) {
415  edm::LogError("TrackerHitProducer::fillTrk")
416  << "Unable to find TrackerHitsPixelBarrelHighTof in event!";
417  return;
418  }
419 
420 
421  sysID = 200; // TrackerHitsPixelBarrelHighTof
422  j = 0;
423  for (itHit = PxlBrlHighContainer->begin(); itHit != PxlBrlHighContainer->end(); ++itHit) {
424 
425  // gather necessary information
426  ++j;
427  HitsSysID.push_back(sysID);
428  HitsDuID.push_back(itHit->detUnitId());
429  HitsTkID.push_back(itHit->trackId());
430  HitsProT.push_back(itHit->processType());
431  HitsParT.push_back(itHit->particleType());
432  HitsP.push_back(itHit->pabs());
433 
434  HitsLpX.push_back(itHit->localPosition().x());
435  HitsLpY.push_back(itHit->localPosition().y());
436  HitsLpZ.push_back(itHit->localPosition().z());
437 
438  HitsLdX.push_back(itHit->localDirection().x());
439  HitsLdY.push_back(itHit->localDirection().y());
440  HitsLdZ.push_back(itHit->localDirection().z());
441  HitsLdTheta.push_back(itHit->localDirection().theta());
442  HitsLdPhi.push_back(itHit->localDirection().phi());
443 
444  HitsExPx.push_back(itHit->exitPoint().x());
445  HitsExPy.push_back(itHit->exitPoint().y());
446  HitsExPz.push_back(itHit->exitPoint().z());
447 
448  HitsEnPx.push_back(itHit->entryPoint().x());
449  HitsEnPy.push_back(itHit->entryPoint().y());
450  HitsEnPz.push_back(itHit->entryPoint().z());
451 
452  HitsEloss.push_back(itHit->energyLoss());
453  HitsToF.push_back(itHit->tof());
454 
455  } // end loop through PxlBrl Hits
456 
457  if (verbosity > 1) {
458  eventout += "\n Number of Pixel Barrel High TOF Hits collected: ";
459  eventout += j;
460  }
461 
462 
464  // get Pixel Forward information
466  // extract low container
467  edm::Handle<edm::PSimHitContainer> PxlFwdLowContainer;
468 // iEvent.getByLabel("g4SimHits","TrackerHitsPixelEndcapLowTof",PxlFwdLowContainer);
469  iEvent.getByLabel(PxlFwdLowSrc_,PxlFwdLowContainer);
470  if (!PxlFwdLowContainer.isValid()) {
471  edm::LogError("TrackerHitProducer::fillTrk")
472  << "Unable to find TrackerHitsPixelEndcapLowTof in event!";
473  return;
474  }
475 
476  sysID = 300; // TrackerHitsPixelEndcapLowTof
477  j = 0;
478  for (itHit = PxlFwdLowContainer->begin(); itHit != PxlFwdLowContainer->end(); ++itHit) {
479 
480  // gather necessary information
481  ++j;
482  HitsSysID.push_back(sysID);
483  HitsDuID.push_back(itHit->detUnitId());
484  HitsTkID.push_back(itHit->trackId());
485  HitsProT.push_back(itHit->processType());
486  HitsParT.push_back(itHit->particleType());
487  HitsP.push_back(itHit->pabs());
488 
489  HitsLpX.push_back(itHit->localPosition().x());
490  HitsLpY.push_back(itHit->localPosition().y());
491  HitsLpZ.push_back(itHit->localPosition().z());
492 
493  HitsLdX.push_back(itHit->localDirection().x());
494  HitsLdY.push_back(itHit->localDirection().y());
495  HitsLdZ.push_back(itHit->localDirection().z());
496  HitsLdTheta.push_back(itHit->localDirection().theta());
497  HitsLdPhi.push_back(itHit->localDirection().phi());
498 
499  HitsExPx.push_back(itHit->exitPoint().x());
500  HitsExPy.push_back(itHit->exitPoint().y());
501  HitsExPz.push_back(itHit->exitPoint().z());
502 
503  HitsEnPx.push_back(itHit->entryPoint().x());
504  HitsEnPy.push_back(itHit->entryPoint().y());
505  HitsEnPz.push_back(itHit->entryPoint().z());
506 
507  HitsEloss.push_back(itHit->energyLoss());
508  HitsToF.push_back(itHit->tof());
509 
510  } // end loop through PxlFwd Hits
511 
512  if (verbosity > 1) {
513  eventout += "\n Number of Pixel Forward Low TOF Hits collected: ";
514  eventout += j;
515  }
516 
517 
518  // extract high container
519  edm::Handle<edm::PSimHitContainer> PxlFwdHighContainer;
520 // iEvent.getByLabel("g4SimHits","TrackerHitsPixelEndcapHighTof",PxlFwdHighContainer);
521  iEvent.getByLabel(PxlFwdHighSrc_,PxlFwdHighContainer);
522  if (!PxlFwdHighContainer.isValid()) {
523  edm::LogError("TrackerHitProducer::fillTrk")
524  << "Unable to find TrackerHitsPixelEndcapHighTof in event!";
525  return;
526  }
527 
528  sysID = 400; // TrackerHitsPixelEndcapHighTof
529  j = 0;
530  for (itHit = PxlFwdHighContainer->begin(); itHit != PxlFwdHighContainer->end(); ++itHit) {
531 
532  // gather necessary information
533  ++j;
534  HitsSysID.push_back(sysID);
535  HitsDuID.push_back(itHit->detUnitId());
536  HitsTkID.push_back(itHit->trackId());
537  HitsProT.push_back(itHit->processType());
538  HitsParT.push_back(itHit->particleType());
539  HitsP.push_back(itHit->pabs());
540 
541  HitsLpX.push_back(itHit->localPosition().x());
542  HitsLpY.push_back(itHit->localPosition().y());
543  HitsLpZ.push_back(itHit->localPosition().z());
544 
545  HitsLdX.push_back(itHit->localDirection().x());
546  HitsLdY.push_back(itHit->localDirection().y());
547  HitsLdZ.push_back(itHit->localDirection().z());
548  HitsLdTheta.push_back(itHit->localDirection().theta());
549  HitsLdPhi.push_back(itHit->localDirection().phi());
550 
551  HitsExPx.push_back(itHit->exitPoint().x());
552  HitsExPy.push_back(itHit->exitPoint().y());
553  HitsExPz.push_back(itHit->exitPoint().z());
554 
555  HitsEnPx.push_back(itHit->entryPoint().x());
556  HitsEnPy.push_back(itHit->entryPoint().y());
557  HitsEnPz.push_back(itHit->entryPoint().z());
558 
559  HitsEloss.push_back(itHit->energyLoss());
560  HitsToF.push_back(itHit->tof());
561 
562  } // end loop through PxlFwd Hits
563 
564  if (verbosity > 1) {
565  eventout += "\n Number of Pixel Forward High TOF Hits collected: ";
566  eventout += j;
567  }
568 
569 
571  // get Silicon TIB information
573  // extract TIB low container
574  edm::Handle<edm::PSimHitContainer> SiTIBLowContainer;
575 // iEvent.getByLabel("g4SimHits","TrackerHitsTIBLowTof",SiTIBLowContainer);
576  iEvent.getByLabel(SiTIBLowSrc_,SiTIBLowContainer);
577  if (!SiTIBLowContainer.isValid()) {
578  edm::LogError("TrackerHitProducer::fillTrk")
579  << "Unable to find TrackerHitsTIBLowTof in event!";
580  return;
581  }
582 
583  sysID = 10; // TrackerHitsTIBLowTof
584  j = 0;
585  for (itHit = SiTIBLowContainer->begin(); itHit != SiTIBLowContainer->end(); ++itHit) {
586 
587  // gather necessary information
588  ++j;
589  HitsSysID.push_back(sysID);
590  HitsDuID.push_back(itHit->detUnitId());
591  HitsTkID.push_back(itHit->trackId());
592  HitsProT.push_back(itHit->processType());
593  HitsParT.push_back(itHit->particleType());
594  HitsP.push_back(itHit->pabs());
595 
596  HitsLpX.push_back(itHit->localPosition().x());
597  HitsLpY.push_back(itHit->localPosition().y());
598  HitsLpZ.push_back(itHit->localPosition().z());
599 
600  HitsLdX.push_back(itHit->localDirection().x());
601  HitsLdY.push_back(itHit->localDirection().y());
602  HitsLdZ.push_back(itHit->localDirection().z());
603  HitsLdTheta.push_back(itHit->localDirection().theta());
604  HitsLdPhi.push_back(itHit->localDirection().phi());
605 
606  HitsExPx.push_back(itHit->exitPoint().x());
607  HitsExPy.push_back(itHit->exitPoint().y());
608  HitsExPz.push_back(itHit->exitPoint().z());
609 
610  HitsEnPx.push_back(itHit->entryPoint().x());
611  HitsEnPy.push_back(itHit->entryPoint().y());
612  HitsEnPz.push_back(itHit->entryPoint().z());
613 
614  HitsEloss.push_back(itHit->energyLoss());
615  HitsToF.push_back(itHit->tof());
616 
617  } // end loop through PxlFwd Hits
618 
619  if (verbosity > 1) {
620  eventout += "\n Number of TIB low TOF Hits collected: ";
621  eventout += j;
622  }
623 
624 
625  // extract TIB high container
626  edm::Handle<edm::PSimHitContainer> SiTIBHighContainer;
627 // iEvent.getByLabel("g4SimHits","TrackerHitsTIBHighTof",SiTIBHighContainer);
628  iEvent.getByLabel(SiTIBHighSrc_,SiTIBHighContainer);
629  if (!SiTIBHighContainer.isValid()) {
630  edm::LogError("TrackerHitProducer::fillTrk")
631  << "Unable to find TrackerHitsTIBHighTof in event!";
632  return;
633  }
634 
635  sysID = 20; // TrackerHitsTIBHighTof
636  j = 0;
637  for (itHit = SiTIBHighContainer->begin(); itHit != SiTIBHighContainer->end(); ++itHit) {
638 
639  // gather necessary information
640  ++j;
641  HitsSysID.push_back(sysID);
642  HitsDuID.push_back(itHit->detUnitId());
643  HitsTkID.push_back(itHit->trackId());
644  HitsProT.push_back(itHit->processType());
645  HitsParT.push_back(itHit->particleType());
646  HitsP.push_back(itHit->pabs());
647 
648  HitsLpX.push_back(itHit->localPosition().x());
649  HitsLpY.push_back(itHit->localPosition().y());
650  HitsLpZ.push_back(itHit->localPosition().z());
651 
652  HitsLdX.push_back(itHit->localDirection().x());
653  HitsLdY.push_back(itHit->localDirection().y());
654  HitsLdZ.push_back(itHit->localDirection().z());
655  HitsLdTheta.push_back(itHit->localDirection().theta());
656  HitsLdPhi.push_back(itHit->localDirection().phi());
657 
658  HitsExPx.push_back(itHit->exitPoint().x());
659  HitsExPy.push_back(itHit->exitPoint().y());
660  HitsExPz.push_back(itHit->exitPoint().z());
661 
662  HitsEnPx.push_back(itHit->entryPoint().x());
663  HitsEnPy.push_back(itHit->entryPoint().y());
664  HitsEnPz.push_back(itHit->entryPoint().z());
665 
666  HitsEloss.push_back(itHit->energyLoss());
667  HitsToF.push_back(itHit->tof());
668 
669  } // end loop through PxlFwd Hits
670 
671  if (verbosity > 1) {
672  eventout += "\n Number of TIB high TOF Hits collected: ";
673  eventout += j;
674  }
675 
677  // get Silicon TOB information
679  // extract TOB low container
680  edm::Handle<edm::PSimHitContainer> SiTOBLowContainer;
681 // iEvent.getByLabel("g4SimHits","TrackerHitsTOBLowTof",SiTOBLowContainer);
682  iEvent.getByLabel(SiTOBLowSrc_,SiTOBLowContainer);
683  if (!SiTOBLowContainer.isValid()) {
684  edm::LogError("TrackerHitProducer::fillTrk")
685  << "Unable to find TrackerHitsTOBLowTof in event!";
686  return;
687  }
688 
689  sysID = 30; // TrackerHitsTOBLowTof
690  j = 0;
691  for (itHit = SiTOBLowContainer->begin(); itHit != SiTOBLowContainer->end(); ++itHit) {
692 
693  // gather necessary information
694  ++j;
695  HitsSysID.push_back(sysID);
696  HitsDuID.push_back(itHit->detUnitId());
697  HitsTkID.push_back(itHit->trackId());
698  HitsProT.push_back(itHit->processType());
699  HitsParT.push_back(itHit->particleType());
700  HitsP.push_back(itHit->pabs());
701 
702  HitsLpX.push_back(itHit->localPosition().x());
703  HitsLpY.push_back(itHit->localPosition().y());
704  HitsLpZ.push_back(itHit->localPosition().z());
705 
706  HitsLdX.push_back(itHit->localDirection().x());
707  HitsLdY.push_back(itHit->localDirection().y());
708  HitsLdZ.push_back(itHit->localDirection().z());
709  HitsLdTheta.push_back(itHit->localDirection().theta());
710  HitsLdPhi.push_back(itHit->localDirection().phi());
711 
712  HitsExPx.push_back(itHit->exitPoint().x());
713  HitsExPy.push_back(itHit->exitPoint().y());
714  HitsExPz.push_back(itHit->exitPoint().z());
715 
716  HitsEnPx.push_back(itHit->entryPoint().x());
717  HitsEnPy.push_back(itHit->entryPoint().y());
718  HitsEnPz.push_back(itHit->entryPoint().z());
719 
720  HitsEloss.push_back(itHit->energyLoss());
721  HitsToF.push_back(itHit->tof());
722 
723  } // end loop through PxlFwd Hits
724 
725  if (verbosity > 1) {
726  eventout += "\n Number of TOB low TOF Hits collected: ";
727  eventout += j;
728  }
729 
730  // extract TOB high container
731  edm::Handle<edm::PSimHitContainer> SiTOBHighContainer;
732 // iEvent.getByLabel("g4SimHits","TrackerHitsTOBHighTof",SiTOBHighContainer);
733  iEvent.getByLabel(SiTOBHighSrc_,SiTOBHighContainer);
734  if (!SiTOBHighContainer.isValid()) {
735  edm::LogError("TrackerHitProducer::fillTrk")
736  << "Unable to find TrackerHitsTOBHighTof in event!";
737  return;
738  }
739 
740  sysID = 40; // TrackerHitsTOBHighTof
741  j = 0;
742  for (itHit = SiTOBHighContainer->begin(); itHit != SiTOBHighContainer->end(); ++itHit) {
743 
744  // gather necessary information
745  ++j;
746  HitsSysID.push_back(sysID);
747  HitsDuID.push_back(itHit->detUnitId());
748  HitsTkID.push_back(itHit->trackId());
749  HitsProT.push_back(itHit->processType());
750  HitsParT.push_back(itHit->particleType());
751  HitsP.push_back(itHit->pabs());
752 
753  HitsLpX.push_back(itHit->localPosition().x());
754  HitsLpY.push_back(itHit->localPosition().y());
755  HitsLpZ.push_back(itHit->localPosition().z());
756 
757  HitsLdX.push_back(itHit->localDirection().x());
758  HitsLdY.push_back(itHit->localDirection().y());
759  HitsLdZ.push_back(itHit->localDirection().z());
760  HitsLdTheta.push_back(itHit->localDirection().theta());
761  HitsLdPhi.push_back(itHit->localDirection().phi());
762 
763  HitsExPx.push_back(itHit->exitPoint().x());
764  HitsExPy.push_back(itHit->exitPoint().y());
765  HitsExPz.push_back(itHit->exitPoint().z());
766 
767  HitsEnPx.push_back(itHit->entryPoint().x());
768  HitsEnPy.push_back(itHit->entryPoint().y());
769  HitsEnPz.push_back(itHit->entryPoint().z());
770 
771  HitsEloss.push_back(itHit->energyLoss());
772  HitsToF.push_back(itHit->tof());
773 
774  } // end loop through SiTOB Hits
775 
776  if (verbosity > 1) {
777  eventout += "\n Number of TOB high TOF Hits collected: ";
778  eventout += j;
779  }
780 
782  // get Silicon TID information
784  // extract TID low container
785  edm::Handle<edm::PSimHitContainer> SiTIDLowContainer;
786 // iEvent.getByLabel("g4SimHits","TrackerHitsTIDLowTof",SiTIDLowContainer);
787  iEvent.getByLabel(SiTIDLowSrc_,SiTIDLowContainer);
788  if (!SiTIDLowContainer.isValid()) {
789  edm::LogError("TrackerHitProducer::fillTrk")
790  << "Unable to find TrackerHitsTIDLowTof in event!";
791  return;
792  }
793 
794  sysID = 50; // TrackerHitsTIDLowTof
795  j = 0;
796  for (itHit = SiTIDLowContainer->begin(); itHit != SiTIDLowContainer->end(); ++itHit) {
797 
798  // gather necessary information
799  ++j;
800  HitsSysID.push_back(sysID);
801  HitsDuID.push_back(itHit->detUnitId());
802  HitsTkID.push_back(itHit->trackId());
803  HitsProT.push_back(itHit->processType());
804  HitsParT.push_back(itHit->particleType());
805  HitsP.push_back(itHit->pabs());
806 
807  HitsLpX.push_back(itHit->localPosition().x());
808  HitsLpY.push_back(itHit->localPosition().y());
809  HitsLpZ.push_back(itHit->localPosition().z());
810 
811  HitsLdX.push_back(itHit->localDirection().x());
812  HitsLdY.push_back(itHit->localDirection().y());
813  HitsLdZ.push_back(itHit->localDirection().z());
814  HitsLdTheta.push_back(itHit->localDirection().theta());
815  HitsLdPhi.push_back(itHit->localDirection().phi());
816 
817  HitsExPx.push_back(itHit->exitPoint().x());
818  HitsExPy.push_back(itHit->exitPoint().y());
819  HitsExPz.push_back(itHit->exitPoint().z());
820 
821  HitsEnPx.push_back(itHit->entryPoint().x());
822  HitsEnPy.push_back(itHit->entryPoint().y());
823  HitsEnPz.push_back(itHit->entryPoint().z());
824 
825  HitsEloss.push_back(itHit->energyLoss());
826  HitsToF.push_back(itHit->tof());
827 
828  } // end loop through SiTID Hits
829 
830  if (verbosity > 1) {
831  eventout += "\n Number of TID low TOF Hits collected: ";
832  eventout += j;
833  }
834 
835  // extract TID high container
836  edm::Handle<edm::PSimHitContainer> SiTIDHighContainer;
837 // iEvent.getByLabel("g4SimHits","TrackerHitsTIDHighTof",SiTIDHighContainer);
838  iEvent.getByLabel(SiTIDHighSrc_,SiTIDHighContainer);
839  if (!SiTIDHighContainer.isValid()) {
840  edm::LogError("TrackerHitProducer::fillTrk")
841  << "Unable to find TrackerHitsTIDHighTof in event!";
842  return;
843  }
844 
845  sysID = 60; // TrackerHitsTIDHighTof
846  j = 0;
847  for (itHit = SiTIDHighContainer->begin(); itHit != SiTIDHighContainer->end(); ++itHit) {
848 
849  // gather necessary information
850  ++j;
851  HitsSysID.push_back(sysID);
852  HitsDuID.push_back(itHit->detUnitId());
853  HitsTkID.push_back(itHit->trackId());
854  HitsProT.push_back(itHit->processType());
855  HitsParT.push_back(itHit->particleType());
856  HitsP.push_back(itHit->pabs());
857 
858  HitsLpX.push_back(itHit->localPosition().x());
859  HitsLpY.push_back(itHit->localPosition().y());
860  HitsLpZ.push_back(itHit->localPosition().z());
861 
862  HitsLdX.push_back(itHit->localDirection().x());
863  HitsLdY.push_back(itHit->localDirection().y());
864  HitsLdZ.push_back(itHit->localDirection().z());
865  HitsLdTheta.push_back(itHit->localDirection().theta());
866  HitsLdPhi.push_back(itHit->localDirection().phi());
867 
868  HitsExPx.push_back(itHit->exitPoint().x());
869  HitsExPy.push_back(itHit->exitPoint().y());
870  HitsExPz.push_back(itHit->exitPoint().z());
871 
872  HitsEnPx.push_back(itHit->entryPoint().x());
873  HitsEnPy.push_back(itHit->entryPoint().y());
874  HitsEnPz.push_back(itHit->entryPoint().z());
875 
876  HitsEloss.push_back(itHit->energyLoss());
877  HitsToF.push_back(itHit->tof());
878 
879  } // end loop through SiTID Hits
880 
881  if (verbosity > 1) {
882  eventout += "\n Number of TID high TOF Hits collected: ";
883  eventout += j;
884  }
885 
887  // get Silicon TEC information
889  // extract TEC low container
890  edm::Handle<edm::PSimHitContainer> SiTECLowContainer;
891 // iEvent.getByLabel("g4SimHits","TrackerHitsTECLowTof",SiTECLowContainer);
892  iEvent.getByLabel(SiTECLowSrc_,SiTECLowContainer);
893  if (!SiTECLowContainer.isValid()) {
894  edm::LogError("TrackerHitProducer::fillTrk")
895  << "Unable to find TrackerHitsTECLowTof in event!";
896  return;
897  }
898 
899  sysID = 70; // TrackerHitsTECLowTof
900  j = 0;
901  for (itHit = SiTECLowContainer->begin(); itHit != SiTECLowContainer->end(); ++itHit) {
902 
903  // gather necessary information
904  ++j;
905  HitsSysID.push_back(sysID);
906  HitsDuID.push_back(itHit->detUnitId());
907  HitsTkID.push_back(itHit->trackId());
908  HitsProT.push_back(itHit->processType());
909  HitsParT.push_back(itHit->particleType());
910  HitsP.push_back(itHit->pabs());
911 
912  HitsLpX.push_back(itHit->localPosition().x());
913  HitsLpY.push_back(itHit->localPosition().y());
914  HitsLpZ.push_back(itHit->localPosition().z());
915 
916  HitsLdX.push_back(itHit->localDirection().x());
917  HitsLdY.push_back(itHit->localDirection().y());
918  HitsLdZ.push_back(itHit->localDirection().z());
919  HitsLdTheta.push_back(itHit->localDirection().theta());
920  HitsLdPhi.push_back(itHit->localDirection().phi());
921 
922  HitsExPx.push_back(itHit->exitPoint().x());
923  HitsExPy.push_back(itHit->exitPoint().y());
924  HitsExPz.push_back(itHit->exitPoint().z());
925 
926  HitsEnPx.push_back(itHit->entryPoint().x());
927  HitsEnPy.push_back(itHit->entryPoint().y());
928  HitsEnPz.push_back(itHit->entryPoint().z());
929 
930  HitsEloss.push_back(itHit->energyLoss());
931  HitsToF.push_back(itHit->tof());
932 
933  } // end loop through SiTEC Hits
934 
935  if (verbosity > 1) {
936  eventout += "\n Number of TEC low TOF Hits collected: ";
937  eventout += j;
938  }
939 
940 
941  // extract TEC high container
942  edm::Handle<edm::PSimHitContainer> SiTECHighContainer;
943 // iEvent.getByLabel("g4SimHits","TrackerHitsTECHighTof",SiTECHighContainer);
944  iEvent.getByLabel(SiTECHighSrc_,SiTECHighContainer);
945  if (!SiTECHighContainer.isValid()) {
946  edm::LogError("TrackerHitProducer::fillTrk")
947  << "Unable to find TrackerHitsTECHighTof in event!";
948  return;
949  }
950  sysID = 80; // TrackerHitsTECHighTof
951  j = 0;
952  for (itHit = SiTECHighContainer->begin(); itHit != SiTECHighContainer->end(); ++itHit) {
953 
954  // gather necessary information
955  ++j;
956  HitsSysID.push_back(sysID);
957  HitsDuID.push_back(itHit->detUnitId());
958  HitsTkID.push_back(itHit->trackId());
959  HitsProT.push_back(itHit->processType());
960  HitsParT.push_back(itHit->particleType());
961  HitsP.push_back(itHit->pabs());
962 
963  HitsLpX.push_back(itHit->localPosition().x());
964  HitsLpY.push_back(itHit->localPosition().y());
965  HitsLpZ.push_back(itHit->localPosition().z());
966 
967  HitsLdX.push_back(itHit->localDirection().x());
968  HitsLdY.push_back(itHit->localDirection().y());
969  HitsLdZ.push_back(itHit->localDirection().z());
970  HitsLdTheta.push_back(itHit->localDirection().theta());
971  HitsLdPhi.push_back(itHit->localDirection().phi());
972 
973  HitsExPx.push_back(itHit->exitPoint().x());
974  HitsExPy.push_back(itHit->exitPoint().y());
975  HitsExPz.push_back(itHit->exitPoint().z());
976 
977  HitsEnPx.push_back(itHit->entryPoint().x());
978  HitsEnPy.push_back(itHit->entryPoint().y());
979  HitsEnPz.push_back(itHit->entryPoint().z());
980 
981  HitsEloss.push_back(itHit->energyLoss());
982  HitsToF.push_back(itHit->tof());
983 
984  } // end loop through SiTEC Hits
985 
986  if (verbosity > 1) {
987  eventout += "\n Number of TEC high TOF Hits collected: ";
988  eventout += j;
989  }
990 
991  if (verbosity > 0)
992  edm::LogInfo("TrackerHitProducer::fillTrk") << eventout;
993 
994  return;
995 }
edm::InputTag SiTIBHighSrc_
edm::InputTag PxlFwdHighSrc_
edm::InputTag PxlBrlHighSrc_
edm::InputTag SiTIDHighSrc_
edm::InputTag PxlFwdLowSrc_
edm::InputTag SiTOBLowSrc_
edm::InputTag SiTECHighSrc_
int j
Definition: DBlmapReader.cc:9
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
edm::InputTag PxlBrlLowSrc_
edm::InputTag SiTECLowSrc_
edm::InputTag SiTIDLowSrc_
edm::InputTag SiTOBHighSrc_
edm::InputTag SiTIBLowSrc_
void TrackerHitProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 102 of file TrackerHitProducer.cc.

References clear(), count, edm::EventID::event(), fillG4MC(), fillTrk(), edm::Event::getAllProvenance(), getAllProvenances, i, edm::EventBase::id(), label, nevt, printProvenanceInfo, edm::Event::put(), edm::EventID::run(), storeG4MC(), storeTrk(), and verbosity.

104 {
105  // keep track of number of events processed
106  ++count;
107 
108  // get event id information
109  int nrun = iEvent.id().run();
110  int nevt = iEvent.id().event();
111 
112  // get event setup information
113  //edm::ESHandle<edm::SetupData> pSetup;
114  //iSetup.get<edm::SetupRecord>().get(pSetup);
115 
116  if (verbosity > 0) {
117  edm::LogInfo ("TrackerHitProducer::produce")
118  << "Processing run" << nrun << "," << "event " << nevt;
119  }
120 
121  // clear event holders
122  clear();
123 
124  // look at information available in the event
125  if (getAllProvenances) {
126 
127  std::vector<const edm::Provenance*> AllProv;
128  iEvent.getAllProvenance(AllProv);
129 
130  if (verbosity > 0)
131  edm::LogInfo ("TrackerHitProducer::produce")
132  << "Number of Provenances =" << AllProv.size();
133 
134  if (printProvenanceInfo && (verbosity > 0)) {
135  TString eventout("\nProvenance info:\n");
136 
137  for (unsigned int i = 0; i < AllProv.size(); ++i) {
138  eventout += "\n ******************************";
139  eventout += "\n Module : ";
140  eventout += AllProv[i]->moduleLabel();
141  eventout += "\n ProductID process index: ";
142  eventout += AllProv[i]->productID().processIndex();
143  eventout += "\n ProductID product index: ";
144  eventout += AllProv[i]->productID().productIndex();
145  eventout += "\n ClassName : ";
146  eventout += AllProv[i]->className();
147  eventout += "\n InstanceName : ";
148  eventout += AllProv[i]->productInstanceName();
149  eventout += "\n BranchName : ";
150  eventout += AllProv[i]->branchName();
151  }
152  eventout += " ******************************\n";
153  edm::LogInfo("TrackerHitProducer::produce") << eventout;
154  }
155  }
156 
157  // call fill functions
158  //gather G4MC information from event
159  fillG4MC(iEvent);
160  // gather Tracker information from event
161  fillTrk(iEvent,iSetup);
162 
163  if (verbosity > 0)
164  edm::LogInfo ("TrackerHitProducer::produce")
165  << "Done gathering data from event.";
166 
167  // produce object to put into event
168  std::auto_ptr<PTrackerSimHit> pOut(new PTrackerSimHit);
169 
170  if (verbosity > 2)
171  edm::LogInfo ("TrackerHitProducer::produce")
172  << "Saving event contents:";
173 
174  // call store functions
175  // store G4MC information in product
176  storeG4MC(*pOut);
177  // store Tracker information in produce
178  storeTrk(*pOut);
179 
180  // store information in event
181  iEvent.put(pOut,label);
182 
183  return;
184 }
RunNumber_t run() const
Definition: EventID.h:42
void fillG4MC(edm::Event &)
void storeTrk(PTrackerSimHit &)
EventNumber_t event() const
Definition: EventID.h:44
void getAllProvenance(std::vector< Provenance const * > &provenances) const
Definition: Event.cc:78
int i
Definition: DBlmapReader.cc:9
void storeG4MC(PTrackerSimHit &)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
edm::EventID id() const
Definition: EventBase.h:56
void fillTrk(edm::Event &, const edm::EventSetup &)
void TrackerHitProducer::storeG4MC ( PTrackerSimHit product)
private

Definition at line 296 of file TrackerHitProducer.cc.

References G4TrkE, G4TrkEta, G4TrkPhi, G4TrkPt, G4VtxX, G4VtxY, G4VtxZ, i, nRawGenPart, PTrackerSimHit::putG4Trk(), PTrackerSimHit::putG4Vtx(), PTrackerSimHit::putRawGenPart(), and verbosity.

Referenced by produce().

297 {
298 
299  if (verbosity > 2) {
300  TString eventout("\nnRawGenPart = ");
301  eventout += nRawGenPart;
302  eventout += "\n nG4Vtx = ";
303  eventout += G4VtxX.size();
304  for (unsigned int i = 0; i < G4VtxX.size(); ++i) {
305  eventout += "\n (x,y,z) = (";
306  eventout += G4VtxX[i];
307  eventout += ", ";
308  eventout += G4VtxY[i];
309  eventout += ", ";
310  eventout += G4VtxZ[i];
311  eventout += ")";
312  }
313  eventout += "\n nG4Trk = ";
314  eventout += G4TrkPt.size();
315  for (unsigned int i = 0; i < G4TrkPt.size(); ++i) {
316  eventout += "\n (pt,e,eta,phi) = (";
317  eventout += G4TrkPt[i];
318  eventout += ", ";
319  eventout += G4TrkE[i];
320  eventout += ")";
321  eventout += G4TrkEta[i];
322  eventout += ")";
323  eventout += G4TrkPhi[i];
324  eventout += ")";
325  }
326  edm::LogInfo("TrackerHitProducer::storeG4MC") << eventout;
327  } // end verbose output
328 
329  product.putRawGenPart(nRawGenPart);
330  product.putG4Vtx(G4VtxX, G4VtxY, G4VtxZ);
332 
333  return;
334 }
int i
Definition: DBlmapReader.cc:9
void putRawGenPart(int n)
void putG4Vtx(const std::vector< float > &x, const std::vector< float > &y, const std::vector< float > &z)
void putG4Trk(const std::vector< float > &pt, const std::vector< float > &e, const std::vector< float > &eta, const std::vector< float > &phi)
void TrackerHitProducer::storeTrk ( PTrackerSimHit product)
private

Definition at line 997 of file TrackerHitProducer.cc.

References HitsDuID, HitsEloss, HitsEnPx, HitsEnPy, HitsEnPz, HitsExPx, HitsExPy, HitsExPz, HitsLdPhi, HitsLdTheta, HitsLdX, HitsLdY, HitsLdZ, HitsLpX, HitsLpY, HitsLpZ, HitsP, HitsParT, HitsProT, HitsSysID, HitsTkID, HitsToF, and PTrackerSimHit::putHits().

Referenced by produce().

998 {
999 
1000 /*
1001  if (verbosity > 2) {
1002  TString eventout("\nnPxlBrlHits = ");
1003  eventout += PxlBrlToF.size();
1004  for (unsigned int i = 0; i < PxlBrlToF.size(); ++i) {
1005  eventout += "\n (tof,r,phi,eta) = (";
1006  eventout += PxlBrlToF[i];
1007  eventout += ", ";
1008  eventout += PxlBrlR[i];
1009  eventout += ", ";
1010  eventout += PxlBrlPhi[i];
1011  eventout += ", ";
1012  eventout += PxlBrlEta[i];
1013  eventout += ")";
1014  } // end PxlBrl output
1015  eventout += "\n nPxlFwdHits = ";
1016  eventout += PxlFwdToF.size();
1017  for (unsigned int i = 0; i < PxlFwdToF.size(); ++i) {
1018  eventout += "\n (tof,z,phi,eta) = (";
1019  eventout += PxlFwdToF[i];
1020  eventout += ", ";
1021  eventout += PxlFwdZ[i];
1022  eventout += ", ";
1023  eventout += PxlFwdPhi[i];
1024  eventout += ", ";
1025  eventout += PxlFwdEta[i];
1026  eventout += ")";
1027  } // end PxlFwd output
1028  eventout += "\n nSiBrlHits = ";
1029  eventout += SiBrlToF.size();
1030  for (unsigned int i = 0; i < SiBrlToF.size(); ++i) {
1031  eventout += "\n (tof,r,phi,eta) = (";
1032  eventout += SiBrlToF[i];
1033  eventout += ", ";
1034  eventout += SiBrlR[i];
1035  eventout += ", ";
1036  eventout += SiBrlPhi[i];
1037  eventout += ", ";
1038  eventout += SiBrlEta[i];
1039  eventout += ")";
1040  } // end SiBrl output
1041  eventout += "\n nSiFwdHits = ";
1042  eventout += SiFwdToF.size();
1043  for (unsigned int i = 0; i < SiFwdToF.size(); ++i) {
1044  eventout += "\n (tof,z,phi,eta) = (";
1045  eventout += SiFwdToF[i];
1046  eventout += ", ";
1047  eventout += SiFwdZ[i];
1048  eventout += ", ";
1049  eventout += SiFwdPhi[i];
1050  eventout += ", ";
1051  eventout += SiFwdEta[i];
1052  eventout += ")";
1053  } // end SiFwd output
1054  edm::LogInfo("TrackerHitProducer::storeTrk") << eventout;
1055  } // end verbose output
1056 */
1058  HitsLpX, HitsLpY, HitsLpZ,
1062  HitsEloss, HitsToF);
1063 
1064  return;
1065 }
void putHits(const std::vector< int > &_sysID, const std::vector< float > &_detUnitId, const std::vector< float > &_trackId, const std::vector< float > &_processType, const std::vector< float > &_particleType, const std::vector< float > &_pabs, const std::vector< float > &_lpx, const std::vector< float > &_lpy, const std::vector< float > &_lpz, const std::vector< float > &_ldx, const std::vector< float > &_ldy, const std::vector< float > &_ldz, const std::vector< float > &_ldtheta, const std::vector< float > &_ldphi, const std::vector< float > &_exx, const std::vector< float > &_exy, const std::vector< float > &_exz, const std::vector< float > &_enx, const std::vector< float > &_eny, const std::vector< float > &_enz, const std::vector< float > &_eloss, const std::vector< float > &_tof)

Member Data Documentation

edm::ParameterSet TrackerHitProducer::config_
private

Definition at line 140 of file TrackerHitProducer.h.

Referenced by fillG4MC().

unsigned int TrackerHitProducer::count
private

Definition at line 142 of file TrackerHitProducer.h.

Referenced by endJob(), and produce().

std::string TrackerHitProducer::fName
private

Definition at line 82 of file TrackerHitProducer.h.

Referenced by TrackerHitProducer().

FloatVector TrackerHitProducer::G4TrkE
private

Definition at line 94 of file TrackerHitProducer.h.

Referenced by clear(), fillG4MC(), and storeG4MC().

FloatVector TrackerHitProducer::G4TrkEta
private

Definition at line 95 of file TrackerHitProducer.h.

Referenced by clear(), fillG4MC(), and storeG4MC().

FloatVector TrackerHitProducer::G4TrkPhi
private

Definition at line 96 of file TrackerHitProducer.h.

Referenced by clear(), fillG4MC(), and storeG4MC().

FloatVector TrackerHitProducer::G4TrkPt
private

Definition at line 93 of file TrackerHitProducer.h.

Referenced by clear(), fillG4MC(), and storeG4MC().

edm::InputTag TrackerHitProducer::G4TrkSrc_
private

Definition at line 138 of file TrackerHitProducer.h.

Referenced by fillG4MC().

edm::InputTag TrackerHitProducer::G4VtxSrc_
private

Definition at line 137 of file TrackerHitProducer.h.

Referenced by fillG4MC().

FloatVector TrackerHitProducer::G4VtxX
private

Definition at line 90 of file TrackerHitProducer.h.

Referenced by clear(), fillG4MC(), and storeG4MC().

FloatVector TrackerHitProducer::G4VtxY
private

Definition at line 91 of file TrackerHitProducer.h.

Referenced by clear(), fillG4MC(), and storeG4MC().

FloatVector TrackerHitProducer::G4VtxZ
private

Definition at line 92 of file TrackerHitProducer.h.

Referenced by clear(), fillG4MC(), and storeG4MC().

bool TrackerHitProducer::getAllProvenances
private

Definition at line 85 of file TrackerHitProducer.h.

Referenced by produce(), and TrackerHitProducer().

FloatVector TrackerHitProducer::HitsDuID
private

Definition at line 103 of file TrackerHitProducer.h.

Referenced by clear(), fillTrk(), and storeTrk().

FloatVector TrackerHitProducer::HitsEloss
private

Definition at line 122 of file TrackerHitProducer.h.

Referenced by clear(), fillTrk(), and storeTrk().

FloatVector TrackerHitProducer::HitsEnPx
private

Definition at line 119 of file TrackerHitProducer.h.

Referenced by clear(), fillTrk(), and storeTrk().

FloatVector TrackerHitProducer::HitsEnPy
private

Definition at line 120 of file TrackerHitProducer.h.

Referenced by clear(), fillTrk(), and storeTrk().

FloatVector TrackerHitProducer::HitsEnPz
private

Definition at line 121 of file TrackerHitProducer.h.

Referenced by clear(), fillTrk(), and storeTrk().

FloatVector TrackerHitProducer::HitsExPx
private

Definition at line 116 of file TrackerHitProducer.h.

Referenced by clear(), fillTrk(), and storeTrk().

FloatVector TrackerHitProducer::HitsExPy
private

Definition at line 117 of file TrackerHitProducer.h.

Referenced by clear(), fillTrk(), and storeTrk().

FloatVector TrackerHitProducer::HitsExPz
private

Definition at line 118 of file TrackerHitProducer.h.

Referenced by clear(), fillTrk(), and storeTrk().

FloatVector TrackerHitProducer::HitsLdPhi
private

Definition at line 115 of file TrackerHitProducer.h.

Referenced by clear(), fillTrk(), and storeTrk().

FloatVector TrackerHitProducer::HitsLdTheta
private

Definition at line 114 of file TrackerHitProducer.h.

Referenced by clear(), fillTrk(), and storeTrk().

FloatVector TrackerHitProducer::HitsLdX
private

Definition at line 111 of file TrackerHitProducer.h.

Referenced by clear(), fillTrk(), and storeTrk().

FloatVector TrackerHitProducer::HitsLdY
private

Definition at line 112 of file TrackerHitProducer.h.

Referenced by clear(), fillTrk(), and storeTrk().

FloatVector TrackerHitProducer::HitsLdZ
private

Definition at line 113 of file TrackerHitProducer.h.

Referenced by clear(), fillTrk(), and storeTrk().

FloatVector TrackerHitProducer::HitsLpX
private

Definition at line 108 of file TrackerHitProducer.h.

Referenced by clear(), fillTrk(), and storeTrk().

FloatVector TrackerHitProducer::HitsLpY
private

Definition at line 109 of file TrackerHitProducer.h.

Referenced by clear(), fillTrk(), and storeTrk().

FloatVector TrackerHitProducer::HitsLpZ
private

Definition at line 110 of file TrackerHitProducer.h.

Referenced by clear(), fillTrk(), and storeTrk().

FloatVector TrackerHitProducer::HitsP
private

Definition at line 107 of file TrackerHitProducer.h.

Referenced by clear(), fillTrk(), and storeTrk().

FloatVector TrackerHitProducer::HitsParT
private

Definition at line 106 of file TrackerHitProducer.h.

Referenced by clear(), fillTrk(), and storeTrk().

FloatVector TrackerHitProducer::HitsProT
private

Definition at line 105 of file TrackerHitProducer.h.

Referenced by clear(), fillTrk(), and storeTrk().

IntegerVector TrackerHitProducer::HitsSysID
private

Definition at line 102 of file TrackerHitProducer.h.

Referenced by clear(), fillTrk(), and storeTrk().

FloatVector TrackerHitProducer::HitsTkID
private

Definition at line 104 of file TrackerHitProducer.h.

Referenced by clear(), fillTrk(), and storeTrk().

FloatVector TrackerHitProducer::HitsToF
private

Definition at line 123 of file TrackerHitProducer.h.

Referenced by clear(), fillTrk(), and storeTrk().

std::string TrackerHitProducer::label
private
int TrackerHitProducer::nRawGenPart
private

Definition at line 89 of file TrackerHitProducer.h.

Referenced by clear(), fillG4MC(), and storeG4MC().

bool TrackerHitProducer::printProvenanceInfo
private

Definition at line 86 of file TrackerHitProducer.h.

Referenced by produce(), and TrackerHitProducer().

edm::InputTag TrackerHitProducer::PxlBrlHighSrc_
private

Definition at line 134 of file TrackerHitProducer.h.

Referenced by fillTrk(), and TrackerHitProducer().

edm::InputTag TrackerHitProducer::PxlBrlLowSrc_
private

Definition at line 133 of file TrackerHitProducer.h.

Referenced by fillTrk(), and TrackerHitProducer().

edm::InputTag TrackerHitProducer::PxlFwdHighSrc_
private

Definition at line 136 of file TrackerHitProducer.h.

Referenced by fillTrk(), and TrackerHitProducer().

edm::InputTag TrackerHitProducer::PxlFwdLowSrc_
private

Definition at line 135 of file TrackerHitProducer.h.

Referenced by fillTrk(), and TrackerHitProducer().

edm::InputTag TrackerHitProducer::SiTECHighSrc_
private

Definition at line 132 of file TrackerHitProducer.h.

Referenced by fillTrk(), and TrackerHitProducer().

edm::InputTag TrackerHitProducer::SiTECLowSrc_
private

Definition at line 131 of file TrackerHitProducer.h.

Referenced by fillTrk(), and TrackerHitProducer().

edm::InputTag TrackerHitProducer::SiTIBHighSrc_
private

Definition at line 126 of file TrackerHitProducer.h.

Referenced by fillTrk(), and TrackerHitProducer().

edm::InputTag TrackerHitProducer::SiTIBLowSrc_
private

Definition at line 125 of file TrackerHitProducer.h.

Referenced by fillTrk(), and TrackerHitProducer().

edm::InputTag TrackerHitProducer::SiTIDHighSrc_
private

Definition at line 130 of file TrackerHitProducer.h.

Referenced by fillTrk(), and TrackerHitProducer().

edm::InputTag TrackerHitProducer::SiTIDLowSrc_
private

Definition at line 129 of file TrackerHitProducer.h.

Referenced by fillTrk(), and TrackerHitProducer().

edm::InputTag TrackerHitProducer::SiTOBHighSrc_
private

Definition at line 128 of file TrackerHitProducer.h.

Referenced by fillTrk(), and TrackerHitProducer().

edm::InputTag TrackerHitProducer::SiTOBLowSrc_
private

Definition at line 127 of file TrackerHitProducer.h.

Referenced by fillTrk(), and TrackerHitProducer().

int TrackerHitProducer::verbosity
private