Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:34:35

0001 #include "Validation/TrackerHits/interface/TrackerHitProducer.h"
0002 
0003 #include "FWCore/Framework/interface/ESHandle.h"
0004 #include "FWCore/Framework/interface/Event.h"
0005 #include "FWCore/Framework/interface/EventSetup.h"
0006 #include "FWCore/Framework/interface/MakerMacros.h"
0007 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0008 
0009 #include "DataFormats/Common/interface/Handle.h"
0010 #include "DataFormats/DetId/interface/DetId.h"
0011 #include "DataFormats/Provenance/interface/Provenance.h"
0012 #include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h"
0013 #include "DataFormats/SiStripDetId/interface/StripSubdetector.h"
0014 
0015 // tracker info
0016 #include "Geometry/CommonDetUnit/interface/GeomDet.h"
0017 #include "Geometry/CommonDetUnit/interface/TrackingGeometry.h"
0018 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0019 
0020 // data in edm::event
0021 #include "SimDataFormats/CaloHit/interface/PCaloHitContainer.h"
0022 #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
0023 #include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h"
0024 #include "SimDataFormats/ValidationFormats/interface/PValidationFormats.h"
0025 
0026 // helper files
0027 #include "CLHEP/Units/GlobalSystemOfUnits.h"
0028 #include <CLHEP/Vector/LorentzVector.h>
0029 
0030 #include "TString.h"
0031 
0032 #include <cmath>
0033 #include <cstdlib>
0034 #include <memory>
0035 
0036 TrackerHitProducer::TrackerHitProducer(const edm::ParameterSet &iPSet)
0037     : getAllProvenances(iPSet.getParameter<edm::ParameterSet>("ProvenanceLookup")
0038                             .getUntrackedParameter<bool>("GetAllProvenances", false)),
0039       printProvenanceInfo(iPSet.getParameter<edm::ParameterSet>("ProvenanceLookup")
0040                               .getUntrackedParameter<bool>("PrintProvenanceInfo", false)),
0041       verbosity(iPSet.getUntrackedParameter<int>("Verbosity", 0)),
0042       count(0),
0043       nRawGenPart(0),
0044       config_(iPSet),
0045       edmHepMCProductToken_(consumes<edm::HepMCProduct>(
0046           edm::InputTag(iPSet.getUntrackedParameter<std::string>("HepMCProductLabel", "source"),
0047                         iPSet.getUntrackedParameter<std::string>("HepMCInputInstance", "")))),
0048       edmSimVertexContainerToken_(consumes<edm::SimVertexContainer>(iPSet.getParameter<edm::InputTag>("G4VtxSrc"))),
0049       edmSimTrackContainerToken_(consumes<edm::SimTrackContainer>(iPSet.getParameter<edm::InputTag>("G4TrkSrc"))),
0050       edmPSimHitContainer_pxlBrlLow_Token_(
0051           consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("PxlBrlLowSrc"))),
0052       edmPSimHitContainer_pxlBrlHigh_Token_(
0053           consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("PxlBrlHighSrc"))),
0054       edmPSimHitContainer_pxlFwdLow_Token_(
0055           consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("PxlFwdLowSrc"))),
0056       edmPSimHitContainer_pxlFwdHigh_Token_(
0057           consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("PxlFwdHighSrc"))),
0058       edmPSimHitContainer_siTIBLow_Token_(
0059           consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("SiTIBLowSrc"))),
0060       edmPSimHitContainer_siTIBHigh_Token_(
0061           consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("SiTIBHighSrc"))),
0062       edmPSimHitContainer_siTOBLow_Token_(
0063           consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("SiTOBLowSrc"))),
0064       edmPSimHitContainer_siTOBHigh_Token_(
0065           consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("SiTOBHighSrc"))),
0066       edmPSimHitContainer_siTIDLow_Token_(
0067           consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("SiTIDLowSrc"))),
0068       edmPSimHitContainer_siTIDHigh_Token_(
0069           consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("SiTIDHighSrc"))),
0070       edmPSimHitContainer_siTECLow_Token_(
0071           consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("SiTECLowSrc"))),
0072       edmPSimHitContainer_siTECHigh_Token_(
0073           consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("SiTECHighSrc"))),
0074       fName(iPSet.getUntrackedParameter<std::string>("Name", "")),
0075       label(iPSet.getParameter<std::string>("Label")) {
0076   // use value of first digit to determine default output level (inclusive)
0077   // 0 is none, 1 is basic, 2 is fill output, 3 is gather output
0078   verbosity %= 10;
0079 
0080   // create persistent object
0081   produces<PTrackerSimHit>(label);
0082 
0083   // print out Parameter Set information being used
0084   if (verbosity > 0) {
0085     edm::LogInfo("TrackerHitProducer::TrackerHitProducer")
0086         << "\n===============================\n"
0087         << "Initialized as EDProducer with parameter values:\n"
0088         << "    Name      =" << fName << "\n"
0089         << "    Verbosity =" << verbosity << "\n"
0090         << "    Label     =" << label << "\n"
0091         << "    GetProv   =" << getAllProvenances << "\n"
0092         << "    PrintProv =" << printProvenanceInfo << "\n"
0093         << "    PxlBrlLowSrc  = " << iPSet.getParameter<edm::InputTag>("PxlBrlLowSrc").label() << ":"
0094         << iPSet.getParameter<edm::InputTag>("PxlBrlLowSrc").instance() << "\n"
0095         << "    PxlBrlHighSrc = " << iPSet.getParameter<edm::InputTag>("PxlBrlHighSrc").label() << ":"
0096         << iPSet.getParameter<edm::InputTag>("PxlBrlHighSrc").instance() << "\n"
0097         << "    PxlFwdLowSrc  = " << iPSet.getParameter<edm::InputTag>("PxlFwdLowSrc").label() << ":"
0098         << iPSet.getParameter<edm::InputTag>("PxlFwdLowSrc").instance() << "\n"
0099         << "    PxlFwdHighSrc = " << iPSet.getParameter<edm::InputTag>("PxlFwdHighSrc").label() << ":"
0100         << iPSet.getParameter<edm::InputTag>("PxlFwdHighSrc").instance() << "\n"
0101         << "    SiTIBLowSrc   = " << iPSet.getParameter<edm::InputTag>("SiTIBLowSrc").label() << ":"
0102         << iPSet.getParameter<edm::InputTag>("SiTIBLowSrc").instance() << "\n"
0103         << "    SiTIBHighSrc  = " << iPSet.getParameter<edm::InputTag>("SiTIBHighSrc").label() << ":"
0104         << iPSet.getParameter<edm::InputTag>("SiTIBHighSrc").instance() << "\n"
0105         << "    SiTOBLowSrc   = " << iPSet.getParameter<edm::InputTag>("SiTOBLowSrc").label() << ":"
0106         << iPSet.getParameter<edm::InputTag>("SiTOBLowSrc").instance() << "\n"
0107         << "    SiTOBHighSrc  = " << iPSet.getParameter<edm::InputTag>("SiTOBHighSrc").label() << ":"
0108         << iPSet.getParameter<edm::InputTag>("SiTOBHighSrc").instance() << "\n"
0109         << "    SiTIDLowSrc   = " << iPSet.getParameter<edm::InputTag>("SiTIDLowSrc").label() << ":"
0110         << iPSet.getParameter<edm::InputTag>("SiTIDLowSrc").instance() << "\n"
0111         << "    SiTIDHighSrc  = " << iPSet.getParameter<edm::InputTag>("SiTIDHighSrc").label() << ":"
0112         << iPSet.getParameter<edm::InputTag>("SiTIDHighSrc").instance() << "\n"
0113         << "    SiTECLowSrc   = " << iPSet.getParameter<edm::InputTag>("SiTECLowSrc").label() << ":"
0114         << iPSet.getParameter<edm::InputTag>("SiTECLowSrc").instance() << "\n"
0115         << "    SiTECHighSrc  = " << iPSet.getParameter<edm::InputTag>("SiTECHighSrc").label() << ":"
0116         << iPSet.getParameter<edm::InputTag>("SiTECHighSrc").instance() << "\n"
0117         << "===============================\n";
0118   }
0119 }
0120 
0121 TrackerHitProducer::~TrackerHitProducer() {}
0122 
0123 void TrackerHitProducer::beginJob() {
0124   if (verbosity > 0)
0125     edm::LogInfo("TrackerHitProducer::beginJob") << "Starting the job...";
0126   clear();
0127   return;
0128 }
0129 
0130 void TrackerHitProducer::endJob() {
0131   if (verbosity > 0)
0132     edm::LogInfo("TrackerHitProducer::endJob") << "Terminating having processed" << count << "events.";
0133   return;
0134 }
0135 
0136 void TrackerHitProducer::produce(edm::Event &iEvent, const edm::EventSetup &iSetup) {
0137   // keep track of number of events processed
0138   ++count;
0139 
0140   // get event id information
0141   edm::RunNumber_t nrun = iEvent.id().run();
0142   edm::EventNumber_t nevt = iEvent.id().event();
0143 
0144   // get event setup information
0145   // edm::ESHandle<edm::SetupData> pSetup;
0146   // iSetup.get<edm::SetupRecord>().get(pSetup);
0147 
0148   if (verbosity > 0) {
0149     edm::LogInfo("TrackerHitProducer::produce") << "Processing run" << nrun << ","
0150                                                 << "event " << nevt;
0151   }
0152 
0153   // clear event holders
0154   clear();
0155 
0156   // look at information available in the event
0157   if (getAllProvenances) {
0158     std::vector<const edm::StableProvenance *> AllProv;
0159     iEvent.getAllStableProvenance(AllProv);
0160 
0161     if (verbosity > 0)
0162       edm::LogInfo("TrackerHitProducer::produce") << "Number of Provenances =" << AllProv.size();
0163 
0164     if (printProvenanceInfo && (verbosity > 0)) {
0165       TString eventout("\nProvenance info:\n");
0166 
0167       for (unsigned int i = 0; i < AllProv.size(); ++i) {
0168         eventout += "\n       ******************************";
0169         eventout += "\n       Module       : ";
0170         eventout += AllProv[i]->moduleLabel();
0171         eventout += "\n       ProductID process index: ";
0172         eventout += AllProv[i]->productID().processIndex();
0173         eventout += "\n       ProductID product index: ";
0174         eventout += AllProv[i]->productID().productIndex();
0175         eventout += "\n       ClassName    : ";
0176         eventout += AllProv[i]->className();
0177         eventout += "\n       InstanceName : ";
0178         eventout += AllProv[i]->productInstanceName();
0179         eventout += "\n       BranchName   : ";
0180         eventout += AllProv[i]->branchName();
0181       }
0182       eventout += "       ******************************\n";
0183       edm::LogInfo("TrackerHitProducer::produce") << eventout;
0184     }
0185   }
0186 
0187   // call fill functions
0188   // gather G4MC information from event
0189   fillG4MC(iEvent);
0190   // gather Tracker information from event
0191   fillTrk(iEvent, iSetup);
0192 
0193   if (verbosity > 0)
0194     edm::LogInfo("TrackerHitProducer::produce") << "Done gathering data from event.";
0195 
0196   // produce object to put into event
0197   std::unique_ptr<PTrackerSimHit> pOut(new PTrackerSimHit);
0198 
0199   if (verbosity > 2)
0200     edm::LogInfo("TrackerHitProducer::produce") << "Saving event contents:";
0201 
0202   // call store functions
0203   // store G4MC information in product
0204   storeG4MC(*pOut);
0205   // store Tracker information in produce
0206   storeTrk(*pOut);
0207 
0208   // store information in event
0209   iEvent.put(std::move(pOut), label);
0210 
0211   return;
0212 }
0213 
0214 //==================fill and store functions================================
0215 void TrackerHitProducer::fillG4MC(edm::Event &iEvent) {
0216   TString eventout;
0217   if (verbosity > 0)
0218     eventout = "\nGathering info:";
0219 
0220   //////////////////////
0221   // get MC information
0222   /////////////////////
0223   edm::Handle<edm::HepMCProduct> HepMCEvt_;
0224   iEvent.getByToken(edmHepMCProductToken_, HepMCEvt_);
0225   if (!HepMCEvt_.isValid()) {
0226     edm::LogError("TrackerHitProducer::fillG4MC") << "Unable to find HepMCProduct in event!";
0227     return;
0228   }
0229   const HepMC::GenEvent *MCEvt = HepMCEvt_->GetEvent();
0230   nRawGenPart = MCEvt->particles_size();
0231 
0232   if (verbosity > 1) {
0233     eventout += "\n          Number of Raw Particles collected:         ";
0234     eventout += nRawGenPart;
0235   }
0236 
0237   ////////////////////////////
0238   // get G4Vertex information
0239   ////////////////////////////
0240   edm::Handle<edm::SimVertexContainer> G4VtxContainer;
0241   iEvent.getByToken(edmSimVertexContainerToken_, G4VtxContainer);
0242   if (!G4VtxContainer.isValid()) {
0243     edm::LogError("TrackerHitProducer::fillG4MC") << "Unable to find SimVertex in event!";
0244     return;
0245   }
0246   int i = 0;
0247   edm::SimVertexContainer::const_iterator itVtx;
0248   for (itVtx = G4VtxContainer->begin(); itVtx != G4VtxContainer->end(); ++itVtx) {
0249     ++i;
0250 
0251     const CLHEP::HepLorentzVector &G4Vtx = CLHEP::HepLorentzVector(
0252         itVtx->position().x(), itVtx->position().y(), itVtx->position().z(), itVtx->position().e());
0253     G4VtxX.push_back(G4Vtx[0] / micrometer);  // cm from code -> micrometer
0254                                               // *10000
0255     G4VtxY.push_back(G4Vtx[1] / micrometer);  // cm from code -> micrometer
0256                                               // *10000
0257     G4VtxZ.push_back(G4Vtx[2] / millimeter);  // cm from code -> millimeter *10
0258   }
0259 
0260   if (verbosity > 1) {
0261     eventout += "\n          Number of G4Vertices collected:            ";
0262     eventout += i;
0263   }
0264 
0265   ///////////////////////////
0266   // get G4Track information
0267   ///////////////////////////
0268   edm::Handle<edm::SimTrackContainer> G4TrkContainer;
0269   iEvent.getByToken(edmSimTrackContainerToken_, G4TrkContainer);
0270   if (!G4TrkContainer.isValid()) {
0271     edm::LogError("TrackerHitProducer::fillG4MC") << "Unable to find SimTrack in event!";
0272     return;
0273   }
0274   i = 0;
0275   edm::SimTrackContainer::const_iterator itTrk;
0276   for (itTrk = G4TrkContainer->begin(); itTrk != G4TrkContainer->end(); ++itTrk) {
0277     ++i;
0278 
0279     double etaInit = 0, phiInit = 0, pInit = 0;
0280     const CLHEP::HepLorentzVector &G4Trk = CLHEP::HepLorentzVector(
0281         itTrk->momentum().x(), itTrk->momentum().y(), itTrk->momentum().z(), itTrk->momentum().e());
0282     pInit = sqrt(G4Trk[0] * G4Trk[0] + G4Trk[1] * G4Trk[1] + G4Trk[2] * G4Trk[2]);
0283     if (pInit == 0)
0284       edm::LogError("TrackerHitProducer::fillG4MC") << "TrackerTest::INFO: Primary has p = 0 ";
0285     else {
0286       double costheta = G4Trk[2] / pInit;
0287       double theta = acos(TMath::Min(TMath::Max(costheta, -1.), 1.));
0288       etaInit = -log(tan(theta / 2));
0289 
0290       if (G4Trk[0] != 0 || G4Trk[1] != 0)
0291         phiInit = atan2(G4Trk[1], G4Trk[0]);
0292     }
0293     G4TrkPt.push_back(sqrt(G4Trk[0] * G4Trk[0] + G4Trk[1] * G4Trk[1]));  // GeV
0294     G4TrkE.push_back(G4Trk[3]);                                          // GeV
0295     G4TrkEta.push_back(etaInit);
0296     G4TrkPhi.push_back(phiInit);
0297   }
0298 
0299   if (verbosity > 1) {
0300     eventout += "\n          Number of G4Tracks collected:              ";
0301     eventout += i;
0302   }
0303 
0304   if (verbosity > 0)
0305     edm::LogInfo("TrackerHitProducer::fillG4MC") << eventout;
0306 
0307   return;
0308 }
0309 
0310 void TrackerHitProducer::storeG4MC(PTrackerSimHit &product) {
0311   if (verbosity > 2) {
0312     TString eventout("\nnRawGenPart        = ");
0313     eventout += nRawGenPart;
0314     eventout += "\n       nG4Vtx             = ";
0315     eventout += G4VtxX.size();
0316     for (unsigned int i = 0; i < G4VtxX.size(); ++i) {
0317       eventout += "\n          (x,y,z)         = (";
0318       eventout += G4VtxX[i];
0319       eventout += ", ";
0320       eventout += G4VtxY[i];
0321       eventout += ", ";
0322       eventout += G4VtxZ[i];
0323       eventout += ")";
0324     }
0325     eventout += "\n       nG4Trk             = ";
0326     eventout += G4TrkPt.size();
0327     for (unsigned int i = 0; i < G4TrkPt.size(); ++i) {
0328       eventout += "\n          (pt,e,eta,phi)          = (";
0329       eventout += G4TrkPt[i];
0330       eventout += ", ";
0331       eventout += G4TrkE[i];
0332       eventout += ")";
0333       eventout += G4TrkEta[i];
0334       eventout += ")";
0335       eventout += G4TrkPhi[i];
0336       eventout += ")";
0337     }
0338     edm::LogInfo("TrackerHitProducer::storeG4MC") << eventout;
0339   }  // end verbose output
0340 
0341   product.putRawGenPart(nRawGenPart);
0342   product.putG4Vtx(G4VtxX, G4VtxY, G4VtxZ);
0343   product.putG4Trk(G4TrkPt, G4TrkE, G4TrkEta, G4TrkPhi);
0344 
0345   return;
0346 }
0347 
0348 void TrackerHitProducer::fillTrk(edm::Event &iEvent, const edm::EventSetup &iSetup) {
0349   TString eventout;
0350   int sysID = 0;
0351   if (verbosity > 0)
0352     eventout = "\nGathering info:";
0353   //////////////////
0354   // iterator to access containers
0355   edm::PSimHitContainer::const_iterator itHit;
0356   //  edm::PSimHitContainer theHits;
0357 
0358   ///////////////////////////////
0359   // get Pixel Barrel information
0360   ///////////////////////////////
0361 
0362   // extract low container
0363   edm::Handle<edm::PSimHitContainer> PxlBrlLowContainer;
0364   iEvent.getByToken(edmPSimHitContainer_pxlBrlLow_Token_, PxlBrlLowContainer);
0365   if (!PxlBrlLowContainer.isValid()) {
0366     edm::LogError("TrackerHitProducer::fillTrk") << "Unable to find TrackerHitsPixelBarrelLowTof in event!";
0367     return;
0368   }
0369 
0370   // place both containers into new container
0371   //  theHits.insert(theHits.end(),PxlBrlLowContainer->begin(),
0372   //             PxlBrlLowContainer->end());
0373 
0374   sysID = 100;  // TrackerHitsPixelBarrelLowTof
0375   int j = 0;
0376   for (itHit = PxlBrlLowContainer->begin(); itHit != PxlBrlLowContainer->end(); ++itHit) {
0377     //  for (itHit = theHits.begin(); itHit != theHits.end(); ++itHit) {
0378 
0379     // gather necessary information
0380     ++j;
0381     HitsSysID.push_back(sysID);
0382     HitsDuID.push_back(itHit->detUnitId());
0383     HitsTkID.push_back(itHit->trackId());
0384     HitsProT.push_back(itHit->processType());
0385     HitsParT.push_back(itHit->particleType());
0386     HitsP.push_back(itHit->pabs());
0387 
0388     HitsLpX.push_back(itHit->localPosition().x());
0389     HitsLpY.push_back(itHit->localPosition().y());
0390     HitsLpZ.push_back(itHit->localPosition().z());
0391 
0392     HitsLdX.push_back(itHit->localDirection().x());
0393     HitsLdY.push_back(itHit->localDirection().y());
0394     HitsLdZ.push_back(itHit->localDirection().z());
0395     HitsLdTheta.push_back(itHit->localDirection().theta());
0396     HitsLdPhi.push_back(itHit->localDirection().phi());
0397 
0398     HitsExPx.push_back(itHit->exitPoint().x());
0399     HitsExPy.push_back(itHit->exitPoint().y());
0400     HitsExPz.push_back(itHit->exitPoint().z());
0401 
0402     HitsEnPx.push_back(itHit->entryPoint().x());
0403     HitsEnPy.push_back(itHit->entryPoint().y());
0404     HitsEnPz.push_back(itHit->entryPoint().z());
0405 
0406     HitsEloss.push_back(itHit->energyLoss());
0407     HitsToF.push_back(itHit->tof());
0408 
0409   }  // end loop through PxlBrl Hits
0410 
0411   if (verbosity > 1) {
0412     eventout += "\n          Number of Pixel Barrel Low TOF Hits collected:     ";
0413     eventout += j;
0414   }
0415 
0416   //  theHits.clear();
0417 
0418   // extract high container
0419   edm::Handle<edm::PSimHitContainer> PxlBrlHighContainer;
0420   iEvent.getByToken(edmPSimHitContainer_pxlBrlHigh_Token_, PxlBrlHighContainer);
0421   if (!PxlBrlHighContainer.isValid()) {
0422     edm::LogError("TrackerHitProducer::fillTrk") << "Unable to find TrackerHitsPixelBarrelHighTof in event!";
0423     return;
0424   }
0425 
0426   sysID = 200;  // TrackerHitsPixelBarrelHighTof
0427   j = 0;
0428   for (itHit = PxlBrlHighContainer->begin(); itHit != PxlBrlHighContainer->end(); ++itHit) {
0429     // gather necessary information
0430     ++j;
0431     HitsSysID.push_back(sysID);
0432     HitsDuID.push_back(itHit->detUnitId());
0433     HitsTkID.push_back(itHit->trackId());
0434     HitsProT.push_back(itHit->processType());
0435     HitsParT.push_back(itHit->particleType());
0436     HitsP.push_back(itHit->pabs());
0437 
0438     HitsLpX.push_back(itHit->localPosition().x());
0439     HitsLpY.push_back(itHit->localPosition().y());
0440     HitsLpZ.push_back(itHit->localPosition().z());
0441 
0442     HitsLdX.push_back(itHit->localDirection().x());
0443     HitsLdY.push_back(itHit->localDirection().y());
0444     HitsLdZ.push_back(itHit->localDirection().z());
0445     HitsLdTheta.push_back(itHit->localDirection().theta());
0446     HitsLdPhi.push_back(itHit->localDirection().phi());
0447 
0448     HitsExPx.push_back(itHit->exitPoint().x());
0449     HitsExPy.push_back(itHit->exitPoint().y());
0450     HitsExPz.push_back(itHit->exitPoint().z());
0451 
0452     HitsEnPx.push_back(itHit->entryPoint().x());
0453     HitsEnPy.push_back(itHit->entryPoint().y());
0454     HitsEnPz.push_back(itHit->entryPoint().z());
0455 
0456     HitsEloss.push_back(itHit->energyLoss());
0457     HitsToF.push_back(itHit->tof());
0458 
0459   }  // end loop through PxlBrl Hits
0460 
0461   if (verbosity > 1) {
0462     eventout += "\n          Number of Pixel Barrel High TOF Hits collected:     ";
0463     eventout += j;
0464   }
0465 
0466   /////////////////////////////////
0467   // get Pixel Forward information
0468   ////////////////////////////////
0469   // extract low container
0470   edm::Handle<edm::PSimHitContainer> PxlFwdLowContainer;
0471   iEvent.getByToken(edmPSimHitContainer_pxlFwdLow_Token_, PxlFwdLowContainer);
0472   if (!PxlFwdLowContainer.isValid()) {
0473     edm::LogError("TrackerHitProducer::fillTrk") << "Unable to find TrackerHitsPixelEndcapLowTof in event!";
0474     return;
0475   }
0476 
0477   sysID = 300;  // TrackerHitsPixelEndcapLowTof
0478   j = 0;
0479   for (itHit = PxlFwdLowContainer->begin(); itHit != PxlFwdLowContainer->end(); ++itHit) {
0480     // gather necessary information
0481     ++j;
0482     HitsSysID.push_back(sysID);
0483     HitsDuID.push_back(itHit->detUnitId());
0484     HitsTkID.push_back(itHit->trackId());
0485     HitsProT.push_back(itHit->processType());
0486     HitsParT.push_back(itHit->particleType());
0487     HitsP.push_back(itHit->pabs());
0488 
0489     HitsLpX.push_back(itHit->localPosition().x());
0490     HitsLpY.push_back(itHit->localPosition().y());
0491     HitsLpZ.push_back(itHit->localPosition().z());
0492 
0493     HitsLdX.push_back(itHit->localDirection().x());
0494     HitsLdY.push_back(itHit->localDirection().y());
0495     HitsLdZ.push_back(itHit->localDirection().z());
0496     HitsLdTheta.push_back(itHit->localDirection().theta());
0497     HitsLdPhi.push_back(itHit->localDirection().phi());
0498 
0499     HitsExPx.push_back(itHit->exitPoint().x());
0500     HitsExPy.push_back(itHit->exitPoint().y());
0501     HitsExPz.push_back(itHit->exitPoint().z());
0502 
0503     HitsEnPx.push_back(itHit->entryPoint().x());
0504     HitsEnPy.push_back(itHit->entryPoint().y());
0505     HitsEnPz.push_back(itHit->entryPoint().z());
0506 
0507     HitsEloss.push_back(itHit->energyLoss());
0508     HitsToF.push_back(itHit->tof());
0509 
0510   }  // end loop through PxlFwd Hits
0511 
0512   if (verbosity > 1) {
0513     eventout += "\n          Number of Pixel Forward Low TOF Hits collected:     ";
0514     eventout += j;
0515   }
0516 
0517   // extract high container
0518   edm::Handle<edm::PSimHitContainer> PxlFwdHighContainer;
0519   iEvent.getByToken(edmPSimHitContainer_pxlFwdHigh_Token_, PxlFwdHighContainer);
0520   if (!PxlFwdHighContainer.isValid()) {
0521     edm::LogError("TrackerHitProducer::fillTrk") << "Unable to find TrackerHitsPixelEndcapHighTof in event!";
0522     return;
0523   }
0524 
0525   sysID = 400;  // TrackerHitsPixelEndcapHighTof
0526   j = 0;
0527   for (itHit = PxlFwdHighContainer->begin(); itHit != PxlFwdHighContainer->end(); ++itHit) {
0528     // gather necessary information
0529     ++j;
0530     HitsSysID.push_back(sysID);
0531     HitsDuID.push_back(itHit->detUnitId());
0532     HitsTkID.push_back(itHit->trackId());
0533     HitsProT.push_back(itHit->processType());
0534     HitsParT.push_back(itHit->particleType());
0535     HitsP.push_back(itHit->pabs());
0536 
0537     HitsLpX.push_back(itHit->localPosition().x());
0538     HitsLpY.push_back(itHit->localPosition().y());
0539     HitsLpZ.push_back(itHit->localPosition().z());
0540 
0541     HitsLdX.push_back(itHit->localDirection().x());
0542     HitsLdY.push_back(itHit->localDirection().y());
0543     HitsLdZ.push_back(itHit->localDirection().z());
0544     HitsLdTheta.push_back(itHit->localDirection().theta());
0545     HitsLdPhi.push_back(itHit->localDirection().phi());
0546 
0547     HitsExPx.push_back(itHit->exitPoint().x());
0548     HitsExPy.push_back(itHit->exitPoint().y());
0549     HitsExPz.push_back(itHit->exitPoint().z());
0550 
0551     HitsEnPx.push_back(itHit->entryPoint().x());
0552     HitsEnPy.push_back(itHit->entryPoint().y());
0553     HitsEnPz.push_back(itHit->entryPoint().z());
0554 
0555     HitsEloss.push_back(itHit->energyLoss());
0556     HitsToF.push_back(itHit->tof());
0557 
0558   }  // end loop through PxlFwd Hits
0559 
0560   if (verbosity > 1) {
0561     eventout += "\n          Number of Pixel Forward High TOF Hits collected:     ";
0562     eventout += j;
0563   }
0564 
0565   ///////////////////////////////////
0566   // get Silicon TIB information
0567   //////////////////////////////////
0568   // extract TIB low container
0569   edm::Handle<edm::PSimHitContainer> SiTIBLowContainer;
0570   iEvent.getByToken(edmPSimHitContainer_siTIBLow_Token_, SiTIBLowContainer);
0571   if (!SiTIBLowContainer.isValid()) {
0572     edm::LogError("TrackerHitProducer::fillTrk") << "Unable to find TrackerHitsTIBLowTof in event!";
0573     return;
0574   }
0575 
0576   sysID = 10;  // TrackerHitsTIBLowTof
0577   j = 0;
0578   for (itHit = SiTIBLowContainer->begin(); itHit != SiTIBLowContainer->end(); ++itHit) {
0579     // gather necessary information
0580     ++j;
0581     HitsSysID.push_back(sysID);
0582     HitsDuID.push_back(itHit->detUnitId());
0583     HitsTkID.push_back(itHit->trackId());
0584     HitsProT.push_back(itHit->processType());
0585     HitsParT.push_back(itHit->particleType());
0586     HitsP.push_back(itHit->pabs());
0587 
0588     HitsLpX.push_back(itHit->localPosition().x());
0589     HitsLpY.push_back(itHit->localPosition().y());
0590     HitsLpZ.push_back(itHit->localPosition().z());
0591 
0592     HitsLdX.push_back(itHit->localDirection().x());
0593     HitsLdY.push_back(itHit->localDirection().y());
0594     HitsLdZ.push_back(itHit->localDirection().z());
0595     HitsLdTheta.push_back(itHit->localDirection().theta());
0596     HitsLdPhi.push_back(itHit->localDirection().phi());
0597 
0598     HitsExPx.push_back(itHit->exitPoint().x());
0599     HitsExPy.push_back(itHit->exitPoint().y());
0600     HitsExPz.push_back(itHit->exitPoint().z());
0601 
0602     HitsEnPx.push_back(itHit->entryPoint().x());
0603     HitsEnPy.push_back(itHit->entryPoint().y());
0604     HitsEnPz.push_back(itHit->entryPoint().z());
0605 
0606     HitsEloss.push_back(itHit->energyLoss());
0607     HitsToF.push_back(itHit->tof());
0608 
0609   }  // end loop through PxlFwd Hits
0610 
0611   if (verbosity > 1) {
0612     eventout += "\n          Number of TIB low TOF Hits collected:     ";
0613     eventout += j;
0614   }
0615 
0616   // extract TIB high container
0617   edm::Handle<edm::PSimHitContainer> SiTIBHighContainer;
0618   iEvent.getByToken(edmPSimHitContainer_siTIBHigh_Token_, SiTIBHighContainer);
0619   if (!SiTIBHighContainer.isValid()) {
0620     edm::LogError("TrackerHitProducer::fillTrk") << "Unable to find TrackerHitsTIBHighTof in event!";
0621     return;
0622   }
0623 
0624   sysID = 20;  // TrackerHitsTIBHighTof
0625   j = 0;
0626   for (itHit = SiTIBHighContainer->begin(); itHit != SiTIBHighContainer->end(); ++itHit) {
0627     // gather necessary information
0628     ++j;
0629     HitsSysID.push_back(sysID);
0630     HitsDuID.push_back(itHit->detUnitId());
0631     HitsTkID.push_back(itHit->trackId());
0632     HitsProT.push_back(itHit->processType());
0633     HitsParT.push_back(itHit->particleType());
0634     HitsP.push_back(itHit->pabs());
0635 
0636     HitsLpX.push_back(itHit->localPosition().x());
0637     HitsLpY.push_back(itHit->localPosition().y());
0638     HitsLpZ.push_back(itHit->localPosition().z());
0639 
0640     HitsLdX.push_back(itHit->localDirection().x());
0641     HitsLdY.push_back(itHit->localDirection().y());
0642     HitsLdZ.push_back(itHit->localDirection().z());
0643     HitsLdTheta.push_back(itHit->localDirection().theta());
0644     HitsLdPhi.push_back(itHit->localDirection().phi());
0645 
0646     HitsExPx.push_back(itHit->exitPoint().x());
0647     HitsExPy.push_back(itHit->exitPoint().y());
0648     HitsExPz.push_back(itHit->exitPoint().z());
0649 
0650     HitsEnPx.push_back(itHit->entryPoint().x());
0651     HitsEnPy.push_back(itHit->entryPoint().y());
0652     HitsEnPz.push_back(itHit->entryPoint().z());
0653 
0654     HitsEloss.push_back(itHit->energyLoss());
0655     HitsToF.push_back(itHit->tof());
0656 
0657   }  // end loop through PxlFwd Hits
0658 
0659   if (verbosity > 1) {
0660     eventout += "\n          Number of TIB high TOF Hits collected:     ";
0661     eventout += j;
0662   }
0663 
0664   ///////////////////////////////////
0665   // get Silicon TOB information
0666   //////////////////////////////////
0667   // extract TOB low container
0668   edm::Handle<edm::PSimHitContainer> SiTOBLowContainer;
0669   iEvent.getByToken(edmPSimHitContainer_siTOBLow_Token_, SiTOBLowContainer);
0670   if (!SiTOBLowContainer.isValid()) {
0671     edm::LogError("TrackerHitProducer::fillTrk") << "Unable to find TrackerHitsTOBLowTof in event!";
0672     return;
0673   }
0674 
0675   sysID = 30;  // TrackerHitsTOBLowTof
0676   j = 0;
0677   for (itHit = SiTOBLowContainer->begin(); itHit != SiTOBLowContainer->end(); ++itHit) {
0678     // gather necessary information
0679     ++j;
0680     HitsSysID.push_back(sysID);
0681     HitsDuID.push_back(itHit->detUnitId());
0682     HitsTkID.push_back(itHit->trackId());
0683     HitsProT.push_back(itHit->processType());
0684     HitsParT.push_back(itHit->particleType());
0685     HitsP.push_back(itHit->pabs());
0686 
0687     HitsLpX.push_back(itHit->localPosition().x());
0688     HitsLpY.push_back(itHit->localPosition().y());
0689     HitsLpZ.push_back(itHit->localPosition().z());
0690 
0691     HitsLdX.push_back(itHit->localDirection().x());
0692     HitsLdY.push_back(itHit->localDirection().y());
0693     HitsLdZ.push_back(itHit->localDirection().z());
0694     HitsLdTheta.push_back(itHit->localDirection().theta());
0695     HitsLdPhi.push_back(itHit->localDirection().phi());
0696 
0697     HitsExPx.push_back(itHit->exitPoint().x());
0698     HitsExPy.push_back(itHit->exitPoint().y());
0699     HitsExPz.push_back(itHit->exitPoint().z());
0700 
0701     HitsEnPx.push_back(itHit->entryPoint().x());
0702     HitsEnPy.push_back(itHit->entryPoint().y());
0703     HitsEnPz.push_back(itHit->entryPoint().z());
0704 
0705     HitsEloss.push_back(itHit->energyLoss());
0706     HitsToF.push_back(itHit->tof());
0707 
0708   }  // end loop through PxlFwd Hits
0709 
0710   if (verbosity > 1) {
0711     eventout += "\n          Number of TOB low TOF Hits collected:     ";
0712     eventout += j;
0713   }
0714 
0715   // extract TOB high container
0716   edm::Handle<edm::PSimHitContainer> SiTOBHighContainer;
0717   iEvent.getByToken(edmPSimHitContainer_siTOBHigh_Token_, SiTOBHighContainer);
0718   if (!SiTOBHighContainer.isValid()) {
0719     edm::LogError("TrackerHitProducer::fillTrk") << "Unable to find TrackerHitsTOBHighTof in event!";
0720     return;
0721   }
0722 
0723   sysID = 40;  // TrackerHitsTOBHighTof
0724   j = 0;
0725   for (itHit = SiTOBHighContainer->begin(); itHit != SiTOBHighContainer->end(); ++itHit) {
0726     // gather necessary information
0727     ++j;
0728     HitsSysID.push_back(sysID);
0729     HitsDuID.push_back(itHit->detUnitId());
0730     HitsTkID.push_back(itHit->trackId());
0731     HitsProT.push_back(itHit->processType());
0732     HitsParT.push_back(itHit->particleType());
0733     HitsP.push_back(itHit->pabs());
0734 
0735     HitsLpX.push_back(itHit->localPosition().x());
0736     HitsLpY.push_back(itHit->localPosition().y());
0737     HitsLpZ.push_back(itHit->localPosition().z());
0738 
0739     HitsLdX.push_back(itHit->localDirection().x());
0740     HitsLdY.push_back(itHit->localDirection().y());
0741     HitsLdZ.push_back(itHit->localDirection().z());
0742     HitsLdTheta.push_back(itHit->localDirection().theta());
0743     HitsLdPhi.push_back(itHit->localDirection().phi());
0744 
0745     HitsExPx.push_back(itHit->exitPoint().x());
0746     HitsExPy.push_back(itHit->exitPoint().y());
0747     HitsExPz.push_back(itHit->exitPoint().z());
0748 
0749     HitsEnPx.push_back(itHit->entryPoint().x());
0750     HitsEnPy.push_back(itHit->entryPoint().y());
0751     HitsEnPz.push_back(itHit->entryPoint().z());
0752 
0753     HitsEloss.push_back(itHit->energyLoss());
0754     HitsToF.push_back(itHit->tof());
0755 
0756   }  // end loop through SiTOB Hits
0757 
0758   if (verbosity > 1) {
0759     eventout += "\n          Number of TOB high TOF Hits collected:     ";
0760     eventout += j;
0761   }
0762 
0763   ///////////////////////////////////
0764   // get Silicon TID information
0765   ///////////////////////////////////
0766   // extract TID low container
0767   edm::Handle<edm::PSimHitContainer> SiTIDLowContainer;
0768   iEvent.getByToken(edmPSimHitContainer_siTIDLow_Token_, SiTIDLowContainer);
0769   if (!SiTIDLowContainer.isValid()) {
0770     edm::LogError("TrackerHitProducer::fillTrk") << "Unable to find TrackerHitsTIDLowTof in event!";
0771     return;
0772   }
0773 
0774   sysID = 50;  // TrackerHitsTIDLowTof
0775   j = 0;
0776   for (itHit = SiTIDLowContainer->begin(); itHit != SiTIDLowContainer->end(); ++itHit) {
0777     // gather necessary information
0778     ++j;
0779     HitsSysID.push_back(sysID);
0780     HitsDuID.push_back(itHit->detUnitId());
0781     HitsTkID.push_back(itHit->trackId());
0782     HitsProT.push_back(itHit->processType());
0783     HitsParT.push_back(itHit->particleType());
0784     HitsP.push_back(itHit->pabs());
0785 
0786     HitsLpX.push_back(itHit->localPosition().x());
0787     HitsLpY.push_back(itHit->localPosition().y());
0788     HitsLpZ.push_back(itHit->localPosition().z());
0789 
0790     HitsLdX.push_back(itHit->localDirection().x());
0791     HitsLdY.push_back(itHit->localDirection().y());
0792     HitsLdZ.push_back(itHit->localDirection().z());
0793     HitsLdTheta.push_back(itHit->localDirection().theta());
0794     HitsLdPhi.push_back(itHit->localDirection().phi());
0795 
0796     HitsExPx.push_back(itHit->exitPoint().x());
0797     HitsExPy.push_back(itHit->exitPoint().y());
0798     HitsExPz.push_back(itHit->exitPoint().z());
0799 
0800     HitsEnPx.push_back(itHit->entryPoint().x());
0801     HitsEnPy.push_back(itHit->entryPoint().y());
0802     HitsEnPz.push_back(itHit->entryPoint().z());
0803 
0804     HitsEloss.push_back(itHit->energyLoss());
0805     HitsToF.push_back(itHit->tof());
0806 
0807   }  // end loop through SiTID Hits
0808 
0809   if (verbosity > 1) {
0810     eventout += "\n          Number of TID low TOF Hits collected:     ";
0811     eventout += j;
0812   }
0813 
0814   // extract TID high container
0815   edm::Handle<edm::PSimHitContainer> SiTIDHighContainer;
0816   iEvent.getByToken(edmPSimHitContainer_siTIDHigh_Token_, SiTIDHighContainer);
0817   if (!SiTIDHighContainer.isValid()) {
0818     edm::LogError("TrackerHitProducer::fillTrk") << "Unable to find TrackerHitsTIDHighTof in event!";
0819     return;
0820   }
0821 
0822   sysID = 60;  // TrackerHitsTIDHighTof
0823   j = 0;
0824   for (itHit = SiTIDHighContainer->begin(); itHit != SiTIDHighContainer->end(); ++itHit) {
0825     // gather necessary information
0826     ++j;
0827     HitsSysID.push_back(sysID);
0828     HitsDuID.push_back(itHit->detUnitId());
0829     HitsTkID.push_back(itHit->trackId());
0830     HitsProT.push_back(itHit->processType());
0831     HitsParT.push_back(itHit->particleType());
0832     HitsP.push_back(itHit->pabs());
0833 
0834     HitsLpX.push_back(itHit->localPosition().x());
0835     HitsLpY.push_back(itHit->localPosition().y());
0836     HitsLpZ.push_back(itHit->localPosition().z());
0837 
0838     HitsLdX.push_back(itHit->localDirection().x());
0839     HitsLdY.push_back(itHit->localDirection().y());
0840     HitsLdZ.push_back(itHit->localDirection().z());
0841     HitsLdTheta.push_back(itHit->localDirection().theta());
0842     HitsLdPhi.push_back(itHit->localDirection().phi());
0843 
0844     HitsExPx.push_back(itHit->exitPoint().x());
0845     HitsExPy.push_back(itHit->exitPoint().y());
0846     HitsExPz.push_back(itHit->exitPoint().z());
0847 
0848     HitsEnPx.push_back(itHit->entryPoint().x());
0849     HitsEnPy.push_back(itHit->entryPoint().y());
0850     HitsEnPz.push_back(itHit->entryPoint().z());
0851 
0852     HitsEloss.push_back(itHit->energyLoss());
0853     HitsToF.push_back(itHit->tof());
0854 
0855   }  // end loop through SiTID Hits
0856 
0857   if (verbosity > 1) {
0858     eventout += "\n          Number of TID high TOF Hits collected:     ";
0859     eventout += j;
0860   }
0861 
0862   ///////////////////////////////////
0863   // get Silicon TEC information
0864   ///////////////////////////////////
0865   // extract TEC low container
0866   edm::Handle<edm::PSimHitContainer> SiTECLowContainer;
0867   iEvent.getByToken(edmPSimHitContainer_siTECLow_Token_, SiTECLowContainer);
0868   if (!SiTECLowContainer.isValid()) {
0869     edm::LogError("TrackerHitProducer::fillTrk") << "Unable to find TrackerHitsTECLowTof in event!";
0870     return;
0871   }
0872 
0873   sysID = 70;  // TrackerHitsTECLowTof
0874   j = 0;
0875   for (itHit = SiTECLowContainer->begin(); itHit != SiTECLowContainer->end(); ++itHit) {
0876     // gather necessary information
0877     ++j;
0878     HitsSysID.push_back(sysID);
0879     HitsDuID.push_back(itHit->detUnitId());
0880     HitsTkID.push_back(itHit->trackId());
0881     HitsProT.push_back(itHit->processType());
0882     HitsParT.push_back(itHit->particleType());
0883     HitsP.push_back(itHit->pabs());
0884 
0885     HitsLpX.push_back(itHit->localPosition().x());
0886     HitsLpY.push_back(itHit->localPosition().y());
0887     HitsLpZ.push_back(itHit->localPosition().z());
0888 
0889     HitsLdX.push_back(itHit->localDirection().x());
0890     HitsLdY.push_back(itHit->localDirection().y());
0891     HitsLdZ.push_back(itHit->localDirection().z());
0892     HitsLdTheta.push_back(itHit->localDirection().theta());
0893     HitsLdPhi.push_back(itHit->localDirection().phi());
0894 
0895     HitsExPx.push_back(itHit->exitPoint().x());
0896     HitsExPy.push_back(itHit->exitPoint().y());
0897     HitsExPz.push_back(itHit->exitPoint().z());
0898 
0899     HitsEnPx.push_back(itHit->entryPoint().x());
0900     HitsEnPy.push_back(itHit->entryPoint().y());
0901     HitsEnPz.push_back(itHit->entryPoint().z());
0902 
0903     HitsEloss.push_back(itHit->energyLoss());
0904     HitsToF.push_back(itHit->tof());
0905 
0906   }  // end loop through SiTEC Hits
0907 
0908   if (verbosity > 1) {
0909     eventout += "\n          Number of TEC low TOF Hits collected:     ";
0910     eventout += j;
0911   }
0912 
0913   // extract TEC high container
0914   edm::Handle<edm::PSimHitContainer> SiTECHighContainer;
0915   iEvent.getByToken(edmPSimHitContainer_siTECHigh_Token_, SiTECHighContainer);
0916   if (!SiTECHighContainer.isValid()) {
0917     edm::LogError("TrackerHitProducer::fillTrk") << "Unable to find TrackerHitsTECHighTof in event!";
0918     return;
0919   }
0920   sysID = 80;  // TrackerHitsTECHighTof
0921   j = 0;
0922   for (itHit = SiTECHighContainer->begin(); itHit != SiTECHighContainer->end(); ++itHit) {
0923     // gather necessary information
0924     ++j;
0925     HitsSysID.push_back(sysID);
0926     HitsDuID.push_back(itHit->detUnitId());
0927     HitsTkID.push_back(itHit->trackId());
0928     HitsProT.push_back(itHit->processType());
0929     HitsParT.push_back(itHit->particleType());
0930     HitsP.push_back(itHit->pabs());
0931 
0932     HitsLpX.push_back(itHit->localPosition().x());
0933     HitsLpY.push_back(itHit->localPosition().y());
0934     HitsLpZ.push_back(itHit->localPosition().z());
0935 
0936     HitsLdX.push_back(itHit->localDirection().x());
0937     HitsLdY.push_back(itHit->localDirection().y());
0938     HitsLdZ.push_back(itHit->localDirection().z());
0939     HitsLdTheta.push_back(itHit->localDirection().theta());
0940     HitsLdPhi.push_back(itHit->localDirection().phi());
0941 
0942     HitsExPx.push_back(itHit->exitPoint().x());
0943     HitsExPy.push_back(itHit->exitPoint().y());
0944     HitsExPz.push_back(itHit->exitPoint().z());
0945 
0946     HitsEnPx.push_back(itHit->entryPoint().x());
0947     HitsEnPy.push_back(itHit->entryPoint().y());
0948     HitsEnPz.push_back(itHit->entryPoint().z());
0949 
0950     HitsEloss.push_back(itHit->energyLoss());
0951     HitsToF.push_back(itHit->tof());
0952 
0953   }  // end loop through SiTEC Hits
0954 
0955   if (verbosity > 1) {
0956     eventout += "\n          Number of TEC high TOF Hits collected:     ";
0957     eventout += j;
0958   }
0959 
0960   if (verbosity > 0)
0961     edm::LogInfo("TrackerHitProducer::fillTrk") << eventout;
0962 
0963   return;
0964 }
0965 
0966 void TrackerHitProducer::storeTrk(PTrackerSimHit &product) {
0967   /*
0968     if (verbosity > 2) {
0969       TString eventout("\nnPxlBrlHits        = ");
0970       eventout += PxlBrlToF.size();
0971       for (unsigned int i = 0; i < PxlBrlToF.size(); ++i) {
0972         eventout += "\n          (tof,r,phi,eta) = (";
0973         eventout += PxlBrlToF[i];
0974         eventout += ", ";
0975         eventout += PxlBrlR[i];
0976         eventout += ", ";
0977         eventout += PxlBrlPhi[i];
0978         eventout += ", ";
0979         eventout += PxlBrlEta[i];
0980         eventout += ")";
0981       } // end PxlBrl output
0982       eventout += "\n       nPxlFwdHits        = ";
0983       eventout += PxlFwdToF.size();
0984       for (unsigned int i = 0; i < PxlFwdToF.size(); ++i) {
0985         eventout += "\n          (tof,z,phi,eta) = (";
0986         eventout += PxlFwdToF[i];
0987         eventout += ", ";
0988         eventout += PxlFwdZ[i];
0989         eventout += ", ";
0990         eventout += PxlFwdPhi[i];
0991         eventout += ", ";
0992         eventout += PxlFwdEta[i];
0993         eventout += ")";
0994       } // end PxlFwd output
0995       eventout += "\n       nSiBrlHits         = ";
0996       eventout += SiBrlToF.size();
0997       for (unsigned int i = 0; i < SiBrlToF.size(); ++i) {
0998         eventout += "\n          (tof,r,phi,eta) = (";
0999         eventout += SiBrlToF[i];
1000         eventout += ", ";
1001         eventout += SiBrlR[i];
1002         eventout += ", ";
1003         eventout += SiBrlPhi[i];
1004         eventout += ", ";
1005         eventout += SiBrlEta[i];
1006         eventout += ")";
1007       } // end SiBrl output
1008       eventout += "\n       nSiFwdHits         = ";
1009       eventout += SiFwdToF.size();
1010       for (unsigned int i = 0; i < SiFwdToF.size(); ++i) {
1011         eventout += "\n          (tof,z,phi,eta) = (";
1012         eventout += SiFwdToF[i];
1013         eventout += ", ";
1014         eventout += SiFwdZ[i];
1015         eventout += ", ";
1016         eventout += SiFwdPhi[i];
1017         eventout += ", ";
1018         eventout += SiFwdEta[i];
1019         eventout += ")";
1020       } // end SiFwd output
1021       edm::LogInfo("TrackerHitProducer::storeTrk") << eventout;
1022     } // end verbose output
1023   */
1024   product.putHits(HitsSysID,
1025                   HitsDuID,
1026                   HitsTkID,
1027                   HitsProT,
1028                   HitsParT,
1029                   HitsP,
1030                   HitsLpX,
1031                   HitsLpY,
1032                   HitsLpZ,
1033                   HitsLdX,
1034                   HitsLdY,
1035                   HitsLdZ,
1036                   HitsLdTheta,
1037                   HitsLdPhi,
1038                   HitsExPx,
1039                   HitsExPy,
1040                   HitsExPz,
1041                   HitsEnPx,
1042                   HitsEnPy,
1043                   HitsEnPz,
1044                   HitsEloss,
1045                   HitsToF);
1046 
1047   return;
1048 }
1049 
1050 void TrackerHitProducer::clear() {
1051   if (verbosity > 0)
1052     edm::LogInfo("GlobalValProducer::clear") << "Clearing event holders";
1053 
1054   // reset G4MC info
1055   nRawGenPart = 0;
1056   G4VtxX.clear();
1057   G4VtxY.clear();
1058   G4VtxZ.clear();
1059   G4TrkPt.clear();
1060   G4TrkE.clear();
1061   G4TrkEta.clear();
1062   G4TrkPhi.clear();
1063   // reset tracker info
1064   HitsSysID.clear();
1065   HitsDuID.clear();
1066   HitsTkID.clear();
1067   HitsProT.clear();
1068   HitsParT.clear();
1069   HitsP.clear();
1070   HitsLpX.clear();
1071   HitsLpY.clear();
1072   HitsLpZ.clear();
1073   HitsLdX.clear();
1074   HitsLdY.clear();
1075   HitsLdZ.clear();
1076   HitsLdTheta.clear();
1077   HitsLdPhi.clear();
1078   HitsExPx.clear();
1079   HitsExPy.clear();
1080   HitsExPz.clear();
1081   HitsEnPx.clear();
1082   HitsEnPy.clear();
1083   HitsEnPz.clear();
1084   HitsEloss.clear();
1085   HitsToF.clear();
1086 
1087   return;
1088 }
1089 
1090 // define this as a plug-in
1091 DEFINE_FWK_MODULE(TrackerHitProducer);