CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
SiStripElectronAnalyzer Class Reference
Inheritance diagram for SiStripElectronAnalyzer:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void endJob (void) override
 
virtual void initNtuple (void)
 
 SiStripElectronAnalyzer (const edm::ParameterSet &)
 
 ~SiStripElectronAnalyzer () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex >
const & 
esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector
< ProductResolverIndexAndSkipBit >
const & 
itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

double unwrapPhi (double phi) const
 

Private Attributes

std::string basicClusterCollection_
 
std::string basicClusterProducer_
 
std::string eBRecHitCollection_
 
std::string eBRecHitProducer_
 
std::string electronCollection_
 
std::string electronProducer_
 
TH1F * emaxSuperClusters_
 
TH1F * emaxSuperClustersEl_
 
TH1F * energySuperClusters_
 
TH1F * energySuperClustersEl_
 
TH1F * energySuperClustersFailed
 
TH1F * energySuperClustersPassed
 
TH1F * eOverPFailed
 
TH1F * eOverPPassed
 
float EShower_ [1000]
 
TFile * file_
 
std::string fileName_
 
int MatchedDetector_ [1000]
 
float MatchedHitCorr_ [1000]
 
float MatchedHitNoise_ [1000]
 
float MatchedHitPhi_ [1000]
 
float MatchedHitR_ [1000]
 
float MatchedHitSignal_ [1000]
 
float MatchedHitSigX_ [1000]
 
float MatchedHitSigY_ [1000]
 
float MatchedHitTheta_ [1000]
 
int MatchedHitWidth_ [1000]
 
float MatchedHitX_ [1000]
 
float MatchedHitY_ [1000]
 
float MatchedHitZ_ [1000]
 
int MatchedLayer_ [1000]
 
std::string mctruthCollection_
 
std::string mctruthProducer_
 
int MonoDetector_ [1000]
 
float MonoHitCorr_ [1000]
 
float MonoHitNoise_ [1000]
 
float MonoHitPhi_ [1000]
 
float MonoHitR_ [1000]
 
float MonoHitSignal_ [1000]
 
float MonoHitSigX_ [1000]
 
float MonoHitSigY_ [1000]
 
float MonoHitTheta_ [1000]
 
int MonoHitWidth_ [1000]
 
float MonoHitX_ [1000]
 
float MonoHitY_ [1000]
 
float MonoHitZ_ [1000]
 
int MonoLayer_ [1000]
 
TTree * myTree_
 
int NMatchedHits_
 
int NMonoHits_
 
int NShowers_
 
int NStereoHits_
 
TH1F * numCand_
 
TH1F * numElectrons_
 
TH1F * numSiMatchedHits_
 
TH1F * numSiMonoHits_
 
TH1F * numSiStereoHits_
 
TH1F * numSuperClusters_
 
TH1F * pDiff
 
TH1F * pElectronFailed
 
TH1F * pElectronPassed
 
TH1F * phiWidthSuperClusters_
 
TH1F * phiWidthSuperClustersEl_
 
TH1F * ptDiff
 
TH1F * ptElectronFailed
 
TH1F * ptElectronPassed
 
std::string siElectronCollection_
 
std::string siElectronProducer_
 
std::string siHitProducer_
 
std::string siMatchedHitCollection_
 
std::string siRphiHitCollection_
 
std::string siStereoHitCollection_
 
TH1F * sizeSuperClusters_
 
TH1F * sizeSuperClustersEl_
 
TH1F * sizeSuperClustersFailed
 
TH1F * sizeSuperClustersPassed
 
int StereoDetector_ [1000]
 
float StereoHitCorr_ [1000]
 
float StereoHitNoise_ [1000]
 
float StereoHitPhi_ [1000]
 
float StereoHitR_ [1000]
 
float StereoHitSignal_ [1000]
 
float StereoHitSigX_ [1000]
 
float StereoHitSigY_ [1000]
 
float StereoHitTheta_ [1000]
 
int StereoHitWidth_ [1000]
 
float StereoHitX_ [1000]
 
float StereoHitY_ [1000]
 
float StereoHitZ_ [1000]
 
int StereoLayer_ [1000]
 
std::string superClusterCollection_
 
std::string superClusterProducer_
 
float XShower_ [1000]
 
float YShower_ [1000]
 
float ZShower_ [1000]
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 57 of file SiStripElectronAnalyzer.cc.

Constructor & Destructor Documentation

SiStripElectronAnalyzer::SiStripElectronAnalyzer ( const edm::ParameterSet iConfig)
explicit

Definition at line 206 of file SiStripElectronAnalyzer.cc.

References eBRecHitCollection_, eBRecHitProducer_, electronCollection_, electronProducer_, emaxSuperClusters_, emaxSuperClustersEl_, energySuperClusters_, energySuperClustersEl_, energySuperClustersFailed, energySuperClustersPassed, eOverPFailed, eOverPPassed, file_, fileName_, edm::ParameterSet::getParameter(), mctruthCollection_, mctruthProducer_, numCand_, numElectrons_, numSiMatchedHits_, numSiMonoHits_, numSiStereoHits_, numSuperClusters_, pDiff, pElectronFailed, pElectronPassed, phiWidthSuperClusters_, phiWidthSuperClustersEl_, ptDiff, ptElectronFailed, ptElectronPassed, siElectronCollection_, siElectronProducer_, siHitProducer_, siMatchedHitCollection_, siRphiHitCollection_, siStereoHitCollection_, sizeSuperClusters_, sizeSuperClustersEl_, sizeSuperClustersFailed, sizeSuperClustersPassed, AlCaHLTBitMon_QueryRunRegistry::string, superClusterCollection_, and superClusterProducer_.

206  {
207  //now do what ever initialization is needed
208  fileName_ = iConfig.getParameter<std::string>("fileName");
209 
210  file_ = new TFile(fileName_.c_str(), "RECREATE");
211  numCand_ = new TH1F("numCandidates", "Number of candidates found", 10, -0.5, 9.5);
212  numElectrons_ = new TH1F("numElectrons", "Number of Electrons found", 10, -0.5, 9.5);
213  numSuperClusters_ = new TH1F("numSuperClusters", "Number of Ecal SuperClusters", 50, 0, 50);
214 
215  energySuperClusters_ = new TH1F("energySuperClusters", "Super Cluster Energy - all ", 200, 0, 2000.);
216  energySuperClustersEl_ = new TH1F("energySuperClustersEl", "Super Cluster Energy - Electron Cands ", 200, 0., 2000.);
217 
218  sizeSuperClusters_ = new TH1F("sizeSuperClusters", "Super Cluster Size - all ", 20, 0, 19);
219  sizeSuperClustersEl_ = new TH1F("sizeSuperClustersEl", "Super Cluster Size - Electron Cands ", 20, 0, 19);
220 
221  emaxSuperClusters_ = new TH1F("emaxSuperClusters", "Super Cluster Emax - all ", 200, 0, 2000.);
222  emaxSuperClustersEl_ = new TH1F("emaxSuperClustersEl", "Super Cluster Emax - Electron Cands ", 200, 0, 2000.);
223 
224  phiWidthSuperClusters_ = new TH1F("phiWidthSuperClusters", "Super Cluster Width - all ", 20, 0., 0.05);
225  phiWidthSuperClustersEl_ = new TH1F("phiWidthSuperClustersEl", "Super Cluster Width - Electron Cands ", 20, 0., 0.05);
226 
227  ptDiff = new TH1F("ptDiff", " ptDiff ", 20, -10., 10.);
228  pDiff = new TH1F("pDiff", " pDiff ", 100, -50., 50.);
229 
230  pElectronFailed = new TH1F("pElectronFailed", " pElectronFailed ", 55, 0., 110.);
231  ptElectronFailed = new TH1F("ptElectronFailed", " ptElectronFailed ", 55, 0., 110.);
232 
233  pElectronPassed = new TH1F("pElectronPassed", " pElectronPassed ", 55, 0., 110.);
234  ptElectronPassed = new TH1F("ptElectronPassed", " ptElectronPassed ", 55, 0., 110.);
235 
236  sizeSuperClustersFailed = new TH1F("sizeSuperClustersFailed", "Super Cluster Size - Failed ", 20, 0, 19);
237  sizeSuperClustersPassed = new TH1F("sizeSuperClustersPassed", "Super Cluster Size - Passed ", 20, 0, 19);
238 
239  energySuperClustersPassed = new TH1F("energySuperClustersPassed", "Super Cluster Energy - Passed ", 125, 0, 250.);
240  energySuperClustersFailed = new TH1F("energySuperClustersFailed", "Super Cluster Energy - Failed ", 125, 0, 250.);
241 
242  eOverPFailed = new TH1F("eOverPFailed", " E over P - Failed ", 50, 0, 10.);
243  eOverPPassed = new TH1F("eOverPPassed", " E over P - Passed ", 50, 0, 10.);
244 
245  numSiStereoHits_ = new TH1F("numSiStereoHits", "Number of Si StereoHits", 100, 0, 1000);
246  numSiMonoHits_ = new TH1F("numSiMonoHits", "Number of Si MonoHits", 100, 0, 1000);
247  numSiMatchedHits_ = new TH1F("numSiMatchedHits", "Number of Si MatchedHits", 100, 0, 1000);
248 
250 
251  mctruthProducer_ = iConfig.getParameter<std::string>("mctruthProducer");
252  mctruthCollection_ = iConfig.getParameter<std::string>("mctruthCollection");
253 
254  superClusterProducer_ = iConfig.getParameter<std::string>("superClusterProducer");
255  superClusterCollection_ = iConfig.getParameter<std::string>("superClusterCollection");
256 
257  eBRecHitProducer_ = iConfig.getParameter<std::string>("recHitProducer");
258  eBRecHitCollection_ = iConfig.getParameter<std::string>("recHitCollection");
259 
260  siElectronProducer_ = iConfig.getParameter<std::string>("siElectronProducer");
261  siElectronCollection_ = iConfig.getParameter<std::string>("siElectronCollection");
262 
263  electronProducer_ = iConfig.getParameter<std::string>("electronProducer");
264  electronCollection_ = iConfig.getParameter<std::string>("electronCollection");
265 
266  siHitProducer_ = iConfig.getParameter<std::string>("siHitProducer");
267  siRphiHitCollection_ = iConfig.getParameter<std::string>("siRphiHitCollection");
268  siStereoHitCollection_ = iConfig.getParameter<std::string>("siStereoHitCollection");
269  siMatchedHitCollection_ = iConfig.getParameter<std::string>("siMatchedHitCollection");
270 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SiStripElectronAnalyzer::~SiStripElectronAnalyzer ( )
override

Definition at line 277 of file SiStripElectronAnalyzer.cc.

References file_.

277  {
278  // do anything here that needs to be done at desctruction time
279  // (e.g. close files, deallocate resources etc.)
280 
281  file_->Write();
282  file_->Close();
283 }

Member Function Documentation

void SiStripElectronAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

For events w/ more than 1 electron candidate, try to plot m(e,e)

//////////////////////////////////////////////////////////////////////////////// ////////////////// Now for tracker hits: ///////////////////////////////////////

loop again to get all info into myTree

Implements edm::one::EDAnalyzerBase.

Definition at line 435 of file SiStripElectronAnalyzer.cc.

References funct::abs(), SiStripRecHit2D::cluster(), counter, alignCSCRings::e, eBRecHitCollection_, eBRecHitProducer_, electronCollection_, electronProducer_, HI_PhotonSkim_cff::electrons, emaxSuperClusters_, emaxSuperClustersEl_, relval_parameters_module::energy, energySuperClusters_, energySuperClustersEl_, EShower_, edm::EventSetup::get(), edm::Event::getByLabel(), mps_fire::i, gpuClustering::id, initNtuple(), edm::Ref< C, T, F >::isNonnull(), BaseTrackerRecHit::localPositionError(), LogDebug, mag(), MatchedDetector_, MatchedHitCorr_, MatchedHitNoise_, MatchedHitPhi_, MatchedHitR_, MatchedHitSignal_, MatchedHitSigX_, MatchedHitSigY_, MatchedHitTheta_, MatchedHitWidth_, MatchedHitX_, MatchedHitY_, MatchedHitZ_, MatchedLayer_, MonoDetector_, MonoHitCorr_, MonoHitNoise_, MonoHitPhi_, MonoHitR_, MonoHitSignal_, MonoHitSigX_, MonoHitSigY_, MonoHitTheta_, MonoHitWidth_, MonoHitX_, MonoHitY_, MonoHitZ_, MonoLayer_, myMaxHits, myTree_, NMatchedHits_, NMonoHits_, NShowers_, NStereoHits_, numCand_, numElectrons_, numSiMatchedHits_, numSiMonoHits_, numSiStereoHits_, numSuperClusters_, pDiff, pElectronFailed, pElectronPassed, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), phiWidthSuperClusters_, phiWidthSuperClustersEl_, position, funct::pow(), ptDiff, ptElectronFailed, ptElectronPassed, siElectronCollection_, siElectronProducer_, siHitProducer_, siMatchedHitCollection_, siRphiHitCollection_, siStereoHitCollection_, sizeSuperClusters_, sizeSuperClustersEl_, sizeSuperClustersFailed, sizeSuperClustersPassed, edmScanValgrind::skipThis, mathSSE::sqrt(), StereoDetector_, StereoHitCorr_, StereoHitNoise_, StereoHitPhi_, StereoHitR_, StereoHitSignal_, StereoHitSigX_, StereoHitSigY_, StereoHitTheta_, StereoHitWidth_, StereoHitX_, StereoHitY_, StereoHitZ_, StereoLayer_, str, superClusterCollection_, superClusterProducer_, PV3DBase< T, PVType, FrameType >::theta(), StripSubdetector::TIB, StripSubdetector::TOB, PV3DBase< T, PVType, FrameType >::x(), XShower_, LocalError::xx(), LocalError::xy(), PV3DBase< T, PVType, FrameType >::y(), YShower_, LocalError::yy(), PV3DBase< T, PVType, FrameType >::z(), and ZShower_.

435  {
436  //Retrieve tracker topology from geometry
438  iSetup.get<TrackerTopologyRcd>().get(tTopo);
439 
440  using namespace std; // so you can say "cout" and "endl"
441 
442  initNtuple();
443 
444  // http://cmsdoc.cern.ch/swdev/lxr/CMSSW/source/clhep/CLHEP/HepMC/GenParticle.h
445  // http://cmsdoc.cern.ch/swdev/lxr/CMSSW/source/clhep/CLHEP/HepMC/GenVertex.h
446  // removed by JED - causes trouble in release post 0_9_0
447  // edm::Handle<edm::HepMCProduct> mctruthHandle;
448  // iEvent.getByLabel(mctruthProducer_, mctruthCollection_, mctruthHandle);
449  // HepMC::GenEvent mctruth = mctruthHandle->getHepMCData();
450 
451  // for (HepMC::GenEvent::particle_const_iterator partIter = mctruth.particles_begin();
452  // partIter != mctruth.particles_end();
453  // ++partIter) {
454  // // for (HepMC::GenEvent::vertex_const_iterator vertIter = mctruth.vertices_begin();
455  // // vertIter != mctruth.vertices_end();
456  // // ++vertIter) {
457  // CLHEP::HepLorentzVector creation = (*partIter)->CreationVertex();
458  // CLHEP::HepLorentzVector momentum = (*partIter)->Momentum();
459  // HepPDT::ParticleID id = (*partIter)->particleID(); // electrons and positrons are 11 and -11
460  // edm::LogInfo("") << "MC particle id " << id.pid() << ", creationVertex " << creation << " cm, initialMomentum " << momentum << " GeV/c" << endl;
461  // }
462 
463  // load the rechits for the Ecal
466  // Create a pointer to the RecHits - unused for now
467  // const EcalRecHitCollection *hitCollection = pRecHits.product();
468 
469  // http://cmsdoc.cern.ch/swdev/lxr/CMSSW/source/self/DataFormats/EgammaReco/interface/SuperCluster.h
472 
475 
476  LogDebug("") << " Start loop over " << clusterHandle->end() - clusterHandle->begin() << " superClusters ";
477 
478  for (reco::SuperClusterCollection::const_iterator clusterIter = clusterHandle->begin();
479  clusterIter != clusterHandle->end();
480  ++clusterIter) {
481  double energy = clusterIter->energy();
482  math::XYZPoint position = clusterIter->position();
483  std::ostringstream str;
484 
485  str << " SuperCluster " << energy << " GeV, position " << position << " cm"
486  << "\n";
487 
488  energySuperClusters_->Fill(energy);
489  sizeSuperClusters_->Fill(clusterIter->clustersSize());
490  // this only makes sense for hybrid superclusters
491 
492  // try to point to the constituent clusters for this SuperCluster
493 
494  str << "About to loop over basicClusters"
495  << "\n";
496 
497  double emaxSuperCluster = 0.;
498  double phibar = 0.;
499  double phi2bar = 0.;
500  double eTotSuperCluster = 0.;
501 
502  for (reco::CaloCluster_iterator basicClusterIter = clusterIter->clustersBegin();
503  basicClusterIter != clusterIter->clustersEnd();
504  ++basicClusterIter) {
505  //std::vector<DetId> theIds= (*basicClusterIter)->getHitsByDetId();
506 
507  str << " basicCluster Energy " << (*basicClusterIter)->energy() << " Position " << (*basicClusterIter)->position()
508  << " \n"
509  << " Position phi " << (*basicClusterIter)->position().phi() << " recHits "
510  << (*basicClusterIter)->size() << " \n";
511 
512  double eCluster = (*basicClusterIter)->energy();
513  if (eCluster > emaxSuperCluster) {
514  emaxSuperCluster = eCluster;
515  }
516  eTotSuperCluster += eCluster;
517  double phiCluster = (*basicClusterIter)->position().phi();
518  phibar += eCluster * phiCluster;
519  phi2bar += eCluster * phiCluster * phiCluster;
520 
521  } // end of basicClusterIter loop
522 
523  phibar = phibar / eTotSuperCluster;
524  phi2bar = phi2bar / eTotSuperCluster;
525  double phiWidth = phi2bar - phibar * phibar;
526  if (phiWidth > 0.) {
527  phiWidth = std::pow(phiWidth, 0.5);
528  } else {
529  phiWidth = 0.;
530  }
531  str << " SuperCluster stats "
532  << "\n";
533  str << "phibar " << phibar << " phi2bar " << phi2bar << " eTotSuperCluster " << eTotSuperCluster << " phiWidth "
534  << phiWidth << std::endl;
535 
536  phiWidthSuperClusters_->Fill(phiWidth);
537 
538  emaxSuperClusters_->Fill(emaxSuperCluster);
539 
540  str << " Done with this SuperCluster " << std::endl;
541 
542  LogDebug("") << str.str();
543 
544  } // end of loop over superClusters
545 
546  LogDebug("") << " End loop over superClusters ";
547 
550 
552  //
553  // loop over all EcalRecHits and print out their x,y,z,E
554  // edm::LogInfo("") << " Dumping all recHits in this event " << endl ;
555  // for(EcalRecHitCollection::const_iterator _blah = hitCollection->begin();
556  // _blah != hitCollection->end() ; ++_blah ) {
557  // edm::LogInfo("") << "Ecal RecHit Energy: " << _blah->energy() << endl ;
558  // // " Position " << _blah.position() << endl ;
559  // }
560  //
561  // edm::LogInfo("") << "Dump finished " << endl ;
562  //
564 
565  // DataFormats/EgammaCandidates/src/SiStripElectron.cc
566  edm::Handle<reco::SiStripElectronCollection> siStripElectronHandle;
567  iEvent.getByLabel(siElectronProducer_, siElectronCollection_, siStripElectronHandle);
568 
570 
571  LogDebug("") << " Dumping Algo's guess of SiStripElectron Candidate Info ";
572  int numberOfElectrons = 0;
573  // need to check if fit succeeded
574  LogDebug("") << " Number of SiStripElectrons " << siStripElectronHandle->size();
575 
576  for (reco::SiStripElectronCollection::const_iterator electronIter = siStripElectronHandle->begin();
577  electronIter != siStripElectronHandle->end();
578  ++electronIter) {
579  LogDebug("") << "about to get stuff from electroncandidate " << numberOfElectrons << "\n"
580  << "supercluster energy = " << electronIter->superCluster()->energy() << "\n"
581  << "fit results are phi(r) = " << electronIter->phiAtOrigin() << " + " << electronIter->phiVsRSlope()
582  << "*r"
583  << "\n"
584  << " chi2 " << electronIter->chi2() << " ndof " << electronIter->ndof() << "\n"
585  << " Pt " << electronIter->pt() << "\n"
586  << "P, Px, Py, Pz " << electronIter->p() << " " << electronIter->px() << " " << electronIter->py()
587  << " " << electronIter->pz() << "\n"
588  << "you get the idea...";
589 
590  // make plots for supercluster that an electron has been associ w/. here
591  energySuperClustersEl_->Fill(electronIter->superCluster()->energy());
592  sizeSuperClustersEl_->Fill(electronIter->superCluster()->clustersSize());
593 
594  // loop over basicClusters to get energy
595  double emaxSuperCluster = 0.;
596  double phibar = 0.;
597  double phi2bar = 0.;
598  double eTotSuperCluster = 0.;
599 
600  for (reco::CaloCluster_iterator basicClusterIter = electronIter->superCluster()->clustersBegin();
601  basicClusterIter != electronIter->superCluster()->clustersEnd();
602  ++basicClusterIter) {
603  //std::vector<DetId> theIds= (*basicClusterIter)->getHitsByDetId();
604 
605  double eCluster = (*basicClusterIter)->energy();
606  if (eCluster > emaxSuperCluster) {
607  emaxSuperCluster = eCluster;
608  }
609  eTotSuperCluster += eCluster;
610  double phiCluster = (*basicClusterIter)->position().phi();
611  phibar += eCluster * phiCluster;
612  phi2bar += eCluster * phiCluster * phiCluster;
613  }
614 
615  phibar = phibar / eTotSuperCluster;
616  phi2bar = phi2bar / eTotSuperCluster;
617  double phiWidth = phi2bar - phibar * phibar;
618  if (phiWidth > 0.) {
619  phiWidth = std::pow(phiWidth, 0.5);
620  } else {
621  phiWidth = 0.;
622  }
623 
624  phiWidthSuperClustersEl_->Fill(phiWidth);
625 
626  emaxSuperClustersEl_->Fill(emaxSuperCluster);
627 
628  numberOfElectrons++;
629  }
630 
631  numCand_->Fill(siStripElectronHandle->size());
632 
634 
635  // Now loop over the electrons (ie the fitted things.)
636 
637  LogDebug("") << " About to check Electrons";
638 
641 
642  numElectrons_->Fill(electrons->end() - electrons->begin());
643 
644  // set up vector of bool for SiStrips having or not having Electrons
645  // this causes a warning because of variable array size at compilation time ;
646  // BAD bool hasElectron_[siStripElectronHandle->end()- siStripElectronHandle->begin()] ;
647  bool* hasElectron_ = new bool[siStripElectronHandle->end() - siStripElectronHandle->begin()];
648  for (int icount = 0; icount < siStripElectronHandle->end() - siStripElectronHandle->begin(); ++icount) {
649  hasElectron_[icount] = false;
650  }
651 
652  // also set up a counter to associate the ith electron to the jth strippy
653  // Electron_to_strippy[i] = j: i-th Electron is j-th strippy
654  // BAD unsigned int Electron_to_strippy[electrons->end()- electrons->begin()];
655  unsigned int* Electron_to_strippy = new unsigned int[electrons->end() - electrons->begin()];
656  for (int icount = 0; icount < electrons->end() - electrons->begin(); ++icount) {
657  Electron_to_strippy[icount] = 0;
658  }
659 
660  unsigned int ecount = 0;
661  for (reco::ElectronCollection::const_iterator electronIter = electrons->begin(); electronIter != electrons->end();
662  ++electronIter) {
663  LogDebug("") << " Associating Electrons to Strippies ";
664  LogDebug("") << " PT is " << electronIter->track()->pt();
665 
666  reco::TrackRef tr = (*electronIter).track();
667  uint32_t id = (*electronIter->track()->recHitsBegin())->geographicalId().rawId();
668  LocalPoint pos = (*electronIter->track()->recHitsBegin())->localPosition();
669 
670  unsigned int icount = 0;
671  LogDebug("") << " About to loop over Strippies "
672  << " \n "
673  << " icount " << icount << " max " << siStripElectronHandle->end() - siStripElectronHandle->begin();
674 
675  for (reco::SiStripElectronCollection::const_iterator strippyiter = siStripElectronHandle->begin();
676  strippyiter != siStripElectronHandle->end();
677  ++strippyiter) {
678  bool hitInCommon = false;
679  // loop over rphi hits
680  for (std::vector<SiStripRecHit2D>::const_iterator hiter = strippyiter->rphiRecHits().begin();
681  hiter != strippyiter->rphiRecHits().end();
682  ++hiter) {
683  if (hiter->geographicalId().rawId() == id && (hiter->localPosition() - pos).mag() < 1e-10) {
684  hitInCommon = true;
685  break;
686  }
687  }
688 
689  for (std::vector<SiStripRecHit2D>::const_iterator hiter = strippyiter->stereoRecHits().begin();
690  hiter != strippyiter->stereoRecHits().end();
691  ++hiter) {
692  if (hiter->geographicalId().rawId() == id && (hiter->localPosition() - pos).mag() < 1e-10) {
693  hitInCommon = true;
694  break;
695  }
696  }
697  if (hitInCommon) { //this Electron belongs to this SiStripElectron.
698  hasElectron_[icount] = true;
699  Electron_to_strippy[ecount] = icount;
700  ptDiff->Fill(std::abs(electronIter->track()->pt()) - std::abs(strippyiter->pt()));
701  pDiff->Fill(std::abs(electronIter->track()->p()) - std::abs(strippyiter->p()));
702  }
703  icount++;
704  } // Sistrip loop
705  ecount++;
706  } // Electrons
707 
708  LogDebug("") << " Done looping over Electrons ";
709 
710  unsigned int counter = 0;
711  for (reco::SiStripElectronCollection::const_iterator strippyIter = siStripElectronHandle->begin();
712  strippyIter != siStripElectronHandle->end();
713  ++strippyIter) {
714  bool skipThis = !hasElectron_[counter];
715  if (skipThis) {
716  // plot stuff for SIStripElectrons that don't have fits associated
717 
718  LogDebug("") << " SiStrip Failed Electron "
719  << " \n "
720  << " p " << strippyIter->p() << " \n "
721  << " pt " << strippyIter->pt() << " \n "
722  << " SuperClust size " << strippyIter->superCluster()->clustersSize();
723 
724  pElectronFailed->Fill(std::abs(strippyIter->p()));
725  ptElectronFailed->Fill(std::abs(strippyIter->pt()));
726  sizeSuperClustersFailed->Fill(strippyIter->superCluster()->clustersSize());
727  LogDebug("") << " done filling Failed histos ";
728  // energySuperClustersFailed->Fill(strippyIter->superCluster()->energy());
729  // if(strippyIter->p()>0.) {
730  // eOverPFailed->Fill(strippyIter->superCluster()->energy()/strippyIter->p());
731  // }else {
732  // eOverPFailed->Fill(-1.0);
733  // }
734 
735  } else {
736  LogDebug("") << " SiStrip Passed Electron "
737  << " \n "
738  << " p " << strippyIter->p() << " \n "
739  << " pt " << strippyIter->pt() << " \n "
740  << " SuperClust size " << strippyIter->superCluster()->clustersSize();
741  pElectronPassed->Fill(std::abs(strippyIter->p()));
742  ptElectronPassed->Fill(std::abs(strippyIter->pt()));
743  sizeSuperClustersPassed->Fill(strippyIter->superCluster()->clustersSize());
744  LogDebug("") << " done filling passed histos ";
745  // energySuperClustersPassed->Fill(strippyIter->superCluster()->energy());
746  // if(strippyIter->p()>0.) {
747  // eOverPPassed->Fill(strippyIter->superCluster()->energy()/strippyIter->p());
748  // }else {
749  // eOverPPassed->Fill(-1.0);
750  // }
751 
752  } // skipThis
753  counter++;
754  }
755 
756  LogDebug("") << "Dump info for all electrons ";
757 
758  for (reco::ElectronCollection::const_iterator electronIter1 = electrons->begin(); electronIter1 != electrons->end();
759  ++electronIter1) {
760  reco::TrackRef tr1 = (*electronIter1).track();
761  // let's find its associated SiStripElectron and SuperCluster
762  unsigned int ecount1 = electronIter1 - electrons->begin();
763  unsigned int stripCount1 = 0;
764  reco::SiStripElectronCollection::const_iterator strippyIter1;
765  for (reco::SiStripElectronCollection::const_iterator strippyIter = siStripElectronHandle->begin();
766  strippyIter != siStripElectronHandle->end();
767  ++strippyIter) {
768  if (Electron_to_strippy[ecount1] == stripCount1) {
769  strippyIter1 = strippyIter;
770  break;
771  }
772  stripCount1++;
773  } // strippy loop
774  ecount1++;
775 
776  std::ostringstream str;
777 
778  str << " SiStripElect p , px, py, pz " << strippyIter1->p() << " " << strippyIter1->px() << " "
779  << strippyIter1->py() << " " << strippyIter1->pz() << "\n " << std::endl;
780 
781  str << " Electron p px, py, pz, = " << tr1->p() << " " << tr1->px() << " " << tr1->py() << " " << tr1->pz()
782  << "\n"
783  << std::endl;
784 
785  double EClust1 = strippyIter1->superCluster()->energy();
786  double XClust1 = strippyIter1->superCluster()->x();
787  double YClust1 = strippyIter1->superCluster()->y();
788  double ZClust1 = strippyIter1->superCluster()->z();
789 
790  double rho1 = sqrt(XClust1 * XClust1 + YClust1 * YClust1 + ZClust1 * ZClust1);
791  double costheta1 = ZClust1 / rho1;
792  double sintheta1 = sqrt(1 - costheta1 * costheta1);
793  if (ZClust1 < 0) {
794  sintheta1 = -sintheta1;
795  }
796  double cosphi1 = XClust1 / sqrt(XClust1 * XClust1 + YClust1 * YClust1);
797  double sinphi1 = YClust1 / sqrt(XClust1 * XClust1 + YClust1 * YClust1);
798 
799  str << " Ecal for electron E, px, py, pz " << EClust1 << " " << EClust1 * sintheta1 * cosphi1 << " "
800  << EClust1 * sintheta1 * sinphi1 << " " << EClust1 * costheta1 << "\n"
801  << std::endl;
802 
803  LogDebug("") << str.str();
804 
805  } // loop over electrons
806  LogDebug("") << "Done Dumping info for all electrons ";
807 
809  // LogDebug("")<< " Checking Electrons" ;
810  // LogDebug("")<< " PT is " << electronIter->track()->pt() ;
811  // reco::TrackRef tr =(*electronIter).track();
813  if (electrons->end() - electrons->begin() > 1) {
814  edm::LogInfo("") << " Two electrons in this event " << std::endl;
815  for (reco::ElectronCollection::const_iterator electronIter1 = electrons->begin();
816  electronIter1 != electrons->end() - 1;
817  ++electronIter1) {
818  reco::TrackRef tr1 = (*electronIter1).track();
819 
820  // let's find its associated SiStripElectron and SuperCluster
821  // use the Electron_to_strippy[] array
822  unsigned int ecount1 = electronIter1 - electrons->begin();
823  // loop over strippies to find the corresponding one
824  unsigned int stripCount1 = 0;
825  reco::SiStripElectronCollection::const_iterator strippyIter1;
826  for (reco::SiStripElectronCollection::const_iterator strippyIter = siStripElectronHandle->begin();
827  strippyIter != siStripElectronHandle->end();
828  ++strippyIter) {
829  if (Electron_to_strippy[ecount1] == stripCount1) {
830  strippyIter1 = strippyIter;
831  break;
832  }
833  stripCount1++;
834  } // strippy loop
835 
836  double EClust1 = strippyIter1->superCluster()->energy();
837  double XClust1 = strippyIter1->superCluster()->x();
838  double YClust1 = strippyIter1->superCluster()->y();
839  double ZClust1 = strippyIter1->superCluster()->z();
840 
841  for (reco::ElectronCollection::const_iterator electronIter2 = electronIter1 + 1;
842  electronIter2 != electrons->end();
843  ++electronIter2) {
844  reco::TrackRef tr2 = (*electronIter2).track();
845 
846  unsigned int ecount2 = electronIter2 - electrons->begin();
847  unsigned int stripCount2 = 0;
848  reco::SiStripElectronCollection::const_iterator strippyIter2;
849  for (reco::SiStripElectronCollection::const_iterator strippyIter = siStripElectronHandle->begin();
850  strippyIter != siStripElectronHandle->end();
851  ++strippyIter) {
852  if (Electron_to_strippy[ecount2] == stripCount2) {
853  strippyIter2 = strippyIter;
854  break;
855  }
856  stripCount2++;
857  } // strippy loop
858 
859  double EClust2 = strippyIter2->superCluster()->energy();
860  double XClust2 = strippyIter2->superCluster()->x();
861  double YClust2 = strippyIter2->superCluster()->y();
862  double ZClust2 = strippyIter2->superCluster()->z();
863 
864  // now get supercluster from this:
865 
866  edm::LogInfo("") << " Electron p1 = " << tr1->p() << " p1x " << tr1->px() << " p1y " << tr1->py() << " p1z "
867  << tr1->pz() << std::endl;
868 
869  edm::LogInfo("") << " Electron p2 = " << tr2->p() << " p2x " << tr2->px() << " p2y " << tr2->py() << " p2z "
870  << tr2->pz() << std::endl;
871 
872  // combine the two in an (e,e) pair
873  double Zpx = tr1->px() + tr2->px();
874  double Zpy = tr1->py() + tr2->py();
875  double Zpz = tr1->pz() + tr2->pz();
876  double Ze = std::abs(tr1->p()) + std::abs(tr2->p());
877  edm::LogInfo("") << " Z mass " << sqrt(Ze * Ze - Zpx * Zpx - Zpy * Zpy - Zpz * Zpz) << std::endl;
878 
879  // combine the SuperClusts into a Z
880  double rho1 = sqrt(XClust1 * XClust1 + YClust1 * YClust1 + ZClust1 * ZClust1);
881  double costheta1 = ZClust1 / rho1;
882  double sintheta1 = sqrt(1 - costheta1 * costheta1);
883  if (ZClust1 < 0) {
884  sintheta1 = -sintheta1;
885  }
886  double cosphi1 = XClust1 / sqrt(XClust1 * XClust1 + YClust1 * YClust1);
887  double sinphi1 = YClust1 / sqrt(XClust1 * XClust1 + YClust1 * YClust1);
888 
889  double rho2 = sqrt(XClust2 * XClust2 + YClust2 * YClust2 + ZClust2 * ZClust2);
890  double costheta2 = ZClust2 / rho2;
891  double sintheta2 = sqrt(1 - costheta2 * costheta2);
892  if (ZClust2 < 0) {
893  sintheta2 = -sintheta2;
894  }
895  double cosphi2 = XClust2 / sqrt(XClust2 * XClust2 + YClust2 * YClust2);
896  double sinphi2 = YClust2 / sqrt(XClust2 * XClust2 + YClust2 * YClust2);
897 
898  edm::LogInfo("") << "Energy of supercluster for 1st electron " << EClust1 << " "
899  << EClust1 * sintheta1 * cosphi1 << " " << EClust1 * sintheta1 * sinphi1 << " "
900  << EClust1 * costheta1 << " " << std::endl;
901 
902  edm::LogInfo("") << "Energy of supercluster for 2nd electron " << EClust2 << " "
903  << EClust2 * sintheta2 * cosphi2 << " " << EClust2 * sintheta2 * sinphi2 << " "
904  << EClust2 * costheta2 << " " << std::endl;
905 
906  // get the supercluster pair
907  double Zgpx = EClust1 * sintheta1 * cosphi1 + EClust2 * sintheta2 * cosphi2;
908  double Zgpy = EClust1 * sintheta1 * sinphi1 + EClust2 * sintheta2 * sinphi2;
909  double Zgpz = EClust1 * costheta1 + EClust2 * costheta2;
910  double ZgE = EClust1 + EClust2;
911 
912  edm::LogInfo("") << " Z mass from ECAL " << sqrt(ZgE * ZgE - Zgpx * Zgpx - Zgpy * Zgpy - Zgpz * Zgpz)
913  << std::endl;
914 
915  } //inner loop
916  } // outer loop
917  } // m(ee) loop
918 
919  delete[] hasElectron_;
920  delete[] Electron_to_strippy;
921 
925  LogDebug("") << " About to dump tracker info ";
926 
927  edm::ESHandle<TrackerGeometry> trackerHandle;
928  iSetup.get<TrackerDigiGeometryRecord>().get(trackerHandle);
929 
931  iEvent.getByLabel(siHitProducer_, siRphiHitCollection_, rphiHitsHandle);
932 
934  iEvent.getByLabel(siHitProducer_, siStereoHitCollection_, stereoHitsHandle);
935 
937  iEvent.getByLabel(siHitProducer_, siMatchedHitCollection_, matchedHitsHandle);
938 
940 
942  NShowers_ = 0;
943  for (reco::SuperClusterCollection::const_iterator clusterIter = clusterHandle->begin();
944  clusterIter != clusterHandle->end();
945  ++clusterIter) {
946  double energy = clusterIter->energy();
947  math::XYZPoint position = clusterIter->position();
948  if (NShowers_ < myMaxHits) {
950  XShower_[NShowers_] = position.x();
951  YShower_[NShowers_] = position.y();
952  ZShower_[NShowers_] = position.z();
953  ++NShowers_;
954  }
955  // Loop over all crystals in this supercluster - see
956  // RecoEcal/EgamaClusterProducers/src/EgammaSimpleAnalyzer.cc
957  // Look also at DataFormats/EgammaReco/interface/SuperCluster.h
958  }
961 
962  LogDebug("") << " Looping over stereo hits ";
963 
965  int myHits = 0;
966  for (SiStripRecHit2DCollection::DataContainer::const_iterator hit = stereoHitsHandle->data().begin(),
967  hitend = stereoHitsHandle->data().end();
968  hit != hitend;
969  ++hit) {
970  DetId id(hit->geographicalId());
971  if ((hit->geographicalId()).subdetId() == StripSubdetector::TIB ||
972  (hit->geographicalId()).subdetId() == StripSubdetector::TOB) {
973  GlobalPoint position = trackerHandle->idToDet(hit->geographicalId())->surface().toGlobal(hit->localPosition());
974  //from RecoLocalTracker/SiStripClusterizer/test/TestCluster.cc
975  // cf also TrackHitAssociator.cc SiStripRecHitMatcher.cc SiStrip1DMeasurementTransformator.cc (KalmanUpdators)
976  SiStripRecHit2D const rechit = *hit;
977  // LocalPoint myposition = rechit.localPosition() ;
978  LocalError myerror = rechit.localPositionError();
979 
980  // Get layer and subdetector ID here for this hit
981  // see SiStripRecHitConverter/test/ValHit.cc
982  Int_t siLayerNum = 0;
983  Int_t siDetNum = 0;
984  string siDetName = "";
985  if ((hit->geographicalId()).subdetId() == StripSubdetector::TIB) {
986  // siLayerNum = tTopo->tibLayer(rechit->geographicalID());
987  siLayerNum = tTopo->tibLayer(id);
988  siDetNum = 1;
989  siDetName = "TIB";
990  } else if ((hit->geographicalId()).subdetId() == StripSubdetector::TOB) {
991  siLayerNum = tTopo->tobLayer(id);
992  siDetNum = 2;
993  siDetName = "TOB";
994  // } else if ( (hit->geographicalId()).subdetId() == StripSubdetector::TID ){
995  // // should we use side/wheel/ring/module/stereo() ?
996  // siLayerNum = tTopo->tidWheel(id);
997  // siDetNum = 3 ;
998  // siDetName = "TID" ;
999  // }else if ( (hit->geographicalId()).subdetId() == StripSubdetector::TEC ){
1000  // //choices are side/petal/wheel/ring/module/glued/stereo
1001  // siLayerNum = tTopo->tecWheel(id);
1002  // siDetNum = 4 ;
1003  // siDetName = "TEC" ;
1004  } else {
1005  siLayerNum = -999;
1006  siDetNum = -999;
1007  siDetName = "NULL";
1008  }
1009  // LogDebug("") << siDetName << " " << siLayerNum ;
1010 
1011  const SiStripRecHit2D::ClusterRef& clust = rechit.cluster();
1012  double Signal = 0;
1013  double Noise2 = 0;
1014  int StripCount = 0;
1015  if (clust.isNonnull()) {
1016  // LogDebug("") << " barycenter " << clust->barycenter() ;
1017  // const std::vector<uint16_t> amplitudes=clust->amplitudes();
1018  const auto& amplitudes = clust->amplitudes();
1019  for (size_t i = 0; i < amplitudes.size(); i++) {
1020  Signal += amplitudes[i];
1021  //ignore for now Noise2 +=SiStripNoiseService_.getNoise(detid,clust->firstStrip()+i)*SiStripNoiseService_.getNoise(detid,clust->firstStrip()+i);
1022  StripCount++;
1023  }
1024  } else {
1025  LogDebug("") << " null cluster ";
1026  }
1027  // LogDebug("") << "Signal " << Signal << " Noise2 " << Noise2 << " StripCount " << StripCount ;
1028  // Dump position
1029  // LogDebug("") << " Stereo "
1030  // << "local position: "<<myposition.x()<<" "
1031  // << myposition.y()<<" "<<myposition.z()<<"\n"
1032  // << "local error: "<<myerror.xx()<<" "
1033  // << myerror.xy()<<" "<<myerror.yy() << "\n"
1034  // << "global position: " << position.x() << " "
1035  // << position.y()<<" "<< position.z()<<"\n"
1036  // << " siDetNum " << siDetNum
1037  // << " siLayerNum " << siLayerNum ;
1038 
1039  if (myHits < myMaxHits) {
1040  StereoHitX_[myHits] = position.x();
1041  StereoHitY_[myHits] = position.y();
1042  StereoHitZ_[myHits] = position.z();
1043 
1044  StereoHitR_[myHits] = position.perp();
1045  StereoHitPhi_[myHits] = position.phi();
1046  StereoHitTheta_[myHits] = position.theta();
1047 
1048  StereoHitSigX_[myHits] = sqrt(myerror.xx());
1049  StereoHitSigY_[myHits] = sqrt(myerror.yy());
1050  StereoHitCorr_[myHits] = myerror.xy() / sqrt(myerror.xx() * myerror.yy());
1051 
1052  StereoHitSignal_[myHits] = Signal;
1053  StereoHitNoise_[myHits] = Noise2;
1054  StereoHitWidth_[myHits] = StripCount;
1055 
1056  StereoDetector_[myHits] = siDetNum;
1057  StereoLayer_[myHits] = siLayerNum;
1058 
1059  ++myHits;
1060  }
1061  } // end if this is the right subdetector
1062  } // end loop over hits
1063  NStereoHits_ = myHits;
1064 
1066 
1069 
1070  LogDebug("") << " Looping over Mono Hits ";
1072  myHits = 0;
1073  for (SiStripRecHit2DCollection::DataContainer::const_iterator hit = rphiHitsHandle->data().begin(),
1074  hitend = rphiHitsHandle->data().end();
1075  hit != hitend;
1076  ++hit) {
1077  DetId id(hit->geographicalId());
1078 
1079  if ((hit->geographicalId()).subdetId() == StripSubdetector::TIB ||
1080  (hit->geographicalId()).subdetId() == StripSubdetector::TOB) {
1081  GlobalPoint position = trackerHandle->idToDet(hit->geographicalId())->surface().toGlobal(hit->localPosition());
1082  //from RecoLocalTracker/SiStripClusterizer/test/TestCluster.cc
1083  // cf also TrackHitAssociator.cc SiStripRecHitMatcher.cc SiStrip1DMeasurementTransformator.cc (KalmanUpdators)
1084  SiStripRecHit2D const rechit = *hit;
1085  // LocalPoint myposition = rechit.localPosition() ;
1086  LocalError myerror = rechit.localPositionError();
1087 
1088  // Get layer and subdetector ID here for this hit
1089  // see SiStripRecHitConverter/test/ValHit.cc
1090  Int_t siLayerNum = 0;
1091  Int_t siDetNum = 0;
1092  string siDetName = "";
1093  if ((hit->geographicalId()).subdetId() == StripSubdetector::TIB) {
1094  // siLayerNum = tTopo->tibLayer(rechit->geographicalID());
1095  siLayerNum = tTopo->tibLayer(id);
1096  siDetNum = 1;
1097  siDetName = "TIB";
1098  } else if ((hit->geographicalId()).subdetId() == StripSubdetector::TOB) {
1099  siLayerNum = tTopo->tobLayer(id);
1100  siDetNum = 2;
1101  siDetName = "TOB";
1102  // } else if ( (hit->geographicalId()).subdetId() == StripSubdetector::TID ){
1103  // // should we use side/wheel/ring/module/stereo() ?
1104  // siLayerNum = tTopo->tidWheel(id);
1105  // siDetNum = 3 ;
1106  // siDetName = "TID" ;
1107  // }else if ( (hit->geographicalId()).subdetId() == StripSubdetector::TEC ){
1108  // //choices are side/petal/wheel/ring/module/glued/stereo
1109  // siLayerNum = tTopo->tecWheel(id);
1110  // siDetNum = 4 ;
1111  // siDetName = "TEC"
1112  ;
1113  } else {
1114  siLayerNum = -999;
1115  siDetNum = -999;
1116  siDetName = "NULL";
1117  }
1118  // LogDebug("") << siDetName << " " << siLayerNum ;
1119  const SiStripRecHit2D::ClusterRef& clust = rechit.cluster();
1120  double Signal = 0;
1121  double Noise2 = 0;
1122  int StripCount = 0;
1123  if (clust.isNonnull()) {
1124  // LogDebug("") << " barycenter " << clust->barycenter() ;
1125  // const std::vector<uint16_t> amplitudes=clust->amplitudes();
1126  const auto& amplitudes = clust->amplitudes();
1127  for (size_t i = 0; i < amplitudes.size(); i++) {
1128  Signal += amplitudes[i];
1129  //ignore for now Noise2 +=SiStripNoiseService_.getNoise(detid,clust->firstStrip()+i)*SiStripNoiseService_.getNoise(detid,clust->firstStrip()+i);
1130  StripCount++;
1131  }
1132  } else {
1133  LogDebug("") << " null cluster ";
1134  }
1135  // LogDebug("") << "Signal " << Signal << " Noise2 " << Noise2 << " StripCount " << StripCount ;
1136 
1137  // Dump position info
1138  // LogDebug("") << " Mono "
1139  // << "local position: "<<myposition.x()<<" "
1140  // << myposition.y()<<" "<<myposition.z()<<"\n"
1141  // <<"local error: "<<myerror.xx()<<" "
1142  // << myerror.xy()<<" "<<myerror.yy() << "\n"
1143  // << "global position: " << position.x() << " "
1144  // << position.y()<<" "<< position.z()<<"\n"
1145  // << " siDetNum " << siDetNum
1146  // << " siLayerNum " << siLayerNum ;
1147 
1148  if (myHits < myMaxHits) {
1149  MonoHitX_[myHits] = position.x();
1150  MonoHitY_[myHits] = position.y();
1151  MonoHitZ_[myHits] = position.z();
1152 
1153  MonoHitR_[myHits] = position.perp();
1154  MonoHitPhi_[myHits] = position.phi();
1155  MonoHitTheta_[myHits] = position.theta();
1156 
1157  MonoHitSigX_[myHits] = sqrt(myerror.xx());
1158  MonoHitSigY_[myHits] = sqrt(myerror.yy());
1159  MonoHitCorr_[myHits] = myerror.xy() / sqrt(myerror.xx() * myerror.yy());
1160 
1161  MonoHitSignal_[myHits] = Signal;
1162  MonoHitNoise_[myHits] = Noise2;
1163  MonoHitWidth_[myHits] = StripCount;
1164 
1165  MonoDetector_[myHits] = siDetNum;
1166  MonoLayer_[myHits] = siLayerNum;
1167 
1168  ++myHits;
1169  } // of if(myHits < myMaxHits)
1170  // LogDebug("")<< "end of myHits < myMaxHits " ;
1171  } // end if this is the right subdetector
1172  // LogDebug("")<< "end of TIB/TOB check " ;
1173  } // end loop over hits
1174  // LogDebug("")<< " end of loop over hits " ;
1175  NMonoHits_ = myHits;
1176 
1177  numSiMonoHits_->Fill(NMonoHits_);
1178 
1181 
1182  LogDebug("") << " Loop over Matched Hits ";
1183 
1185  myHits = 0;
1186  for (SiStripMatchedRecHit2DCollection::DataContainer::const_iterator hit = matchedHitsHandle->data().begin(),
1187  hitend = matchedHitsHandle->data().end();
1188  hit != hitend;
1189  ++hit) {
1190  DetId id(hit->geographicalId());
1191  if ((hit->geographicalId()).subdetId() == StripSubdetector::TIB ||
1192  (hit->geographicalId()).subdetId() == StripSubdetector::TOB) {
1193  GlobalPoint position = trackerHandle->idToDet(hit->geographicalId())->surface().toGlobal(hit->localPosition());
1194  SiStripMatchedRecHit2D const rechit = *hit;
1195  // LocalPoint myposition = rechit.localPosition() ;
1196  LocalError myerror = rechit.localPositionError();
1197 
1198  // Get layer and subdetector ID here for this hit
1199  // see SiStripRecHitConverter/test/ValHit.cc
1200  Int_t siLayerNum = 0;
1201  Int_t siDetNum = 0;
1202  string siDetName = "";
1203  if ((hit->geographicalId()).subdetId() == StripSubdetector::TIB) {
1204  siLayerNum = tTopo->tibLayer(id);
1205  siDetNum = 1;
1206  siDetName = "TIB";
1207  } else if ((hit->geographicalId()).subdetId() == StripSubdetector::TOB) {
1208  siLayerNum = tTopo->tobLayer(id);
1209  siDetNum = 2;
1210  siDetName = "TOB";
1211  // } else if ( (hit->geographicalId()).subdetId() == StripSubdetector::TID ){
1212  // // should we use side/wheel/ring/module/stereo() ?
1213  // siLayerNum = tTopo->tidWheel(id);
1214  // siDetNum = 3 ;
1215  // siDetName = "TID" ;
1216  // }else if ( (hit->geographicalId()).subdetId() == StripSubdetector::TEC ){
1217  // //choices are side/petal/wheel/ring/module/glued/stereo
1218  // siLayerNum = tTopo->tecWheel(id);
1219  // siDetNum = 4 ;
1220  // siDetName = "TEC" ;
1221  } else {
1222  siLayerNum = -999;
1223  siDetNum = -999;
1224  siDetName = "NULL";
1225  }
1226  // const edm::Ref<edm::DetSetVector<SiStripCluster>, SiStripCluster, edm::refhelper::FindForDetSetVector<SiStripCluster> > clust=rechit.cluster();
1227  double Signal = 0;
1228  double Noise2 = 0;
1229  int StripCount = 0;
1230  // if(clust.isNonnull()) {
1231  // LogDebug("") << " barycenter " << clust->barycenter() ;
1232  // const std::vector<uint16_t> amplitudes=clust->amplitudes();
1233  // for(size_t i = 0 ; i<amplitudes.size(); i++ ){
1234  // Signal +=amplitudes[i] ;
1235  // //ignore for now Noise2 +=SiStripNoiseService_.getNoise(detid,clust->firstStrip()+i)*SiStripNoiseService_.getNoise(detid,clust->firstStrip()+i);
1236  // StripCount++;
1237  // }
1238  // } else {
1239  // LogDebug("") << " null cluster " ;
1240  // }
1241  // LogDebug("") << "Signal " << Signal << " Noise2 " << Noise2 << " StripCount " << StripCount ;
1242 
1243  // Dump position info
1244  // LogDebug("") << " Matched "
1245  // << "local position: "<<myposition.x()<<" "
1246  // << myposition.y()<<" "<<myposition.z()<<"\n"
1247  // << "local error: "<<myerror.xx()<<" "
1248  // << myerror.xy()<<" "<<myerror.yy() << "\n"
1249  // << "global position: " << position.x() << " "
1250  // << position.y()<<" "<< position.z()<<"\n"
1251  // << " siDetNum " << siDetNum
1252  // << " siLayerNum " << siLayerNum ;
1253 
1254  if (myHits < myMaxHits) {
1255  MatchedHitX_[myHits] = position.x();
1256  MatchedHitY_[myHits] = position.y();
1257  MatchedHitZ_[myHits] = position.z();
1258 
1259  MatchedHitR_[myHits] = position.perp();
1260  MatchedHitPhi_[myHits] = position.phi();
1261  MatchedHitTheta_[myHits] = position.theta();
1262 
1263  MatchedHitSigX_[myHits] = sqrt(myerror.xx());
1264  MatchedHitSigY_[myHits] = sqrt(myerror.yy());
1265  MatchedHitCorr_[myHits] = myerror.xy() / sqrt(myerror.xx() * myerror.yy());
1266 
1267  MatchedHitSignal_[myHits] = Signal;
1268  MatchedHitNoise_[myHits] = Noise2;
1269  MatchedHitWidth_[myHits] = StripCount;
1270 
1271  MatchedDetector_[myHits] = siDetNum;
1272  MatchedLayer_[myHits] = siLayerNum;
1273 
1274  ++myHits;
1275  }
1276  } // end if this is the right subdetector (TIB/TOB)
1277  } // end loop over hits
1278  NMatchedHits_ = myHits;
1279 
1281 
1283 
1286  LogDebug("") << "Writing to myTree with " << NShowers_ << " Showers " << NStereoHits_ << " Si StereoHits "
1287  << NMonoHits_ << " Si MonoHits " << NMatchedHits_ << " Si MatchedHits ";
1288 
1289  myTree_->Fill();
1290 
1291 } // end of Analyzer
#define myMaxHits
float xx() const
Definition: LocalError.h:22
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
T perp() const
Definition: PV3DBase.h:69
uint16_t *__restrict__ id
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
T y() const
Definition: PV3DBase.h:60
Geom::Theta< T > theta() const
Definition: PV3DBase.h:72
float xy() const
Definition: LocalError.h:23
float yy() const
Definition: LocalError.h:24
T sqrt(T t)
Definition: SSEVec.h:19
T z() const
Definition: PV3DBase.h:61
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ClusterRef cluster() const
static constexpr auto TOB
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:500
Log< level::Info, false > LogInfo
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
LocalError localPositionError() const override
Definition: DetId.h:17
static constexpr auto TIB
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
static std::atomic< unsigned int > counter
static int position[264][3]
Definition: ReadPGInfo.cc:289
T get() const
Definition: EventSetup.h:88
#define str(s)
T x() const
Definition: PV3DBase.h:59
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
#define LogDebug(id)
void SiStripElectronAnalyzer::beginJob ( void  )
overridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 301 of file SiStripElectronAnalyzer.cc.

References EShower_, MatchedDetector_, MatchedHitCorr_, MatchedHitNoise_, MatchedHitPhi_, MatchedHitR_, MatchedHitSignal_, MatchedHitSigX_, MatchedHitSigY_, MatchedHitTheta_, MatchedHitWidth_, MatchedHitX_, MatchedHitY_, MatchedHitZ_, MatchedLayer_, MonoDetector_, MonoHitCorr_, MonoHitNoise_, MonoHitPhi_, MonoHitR_, MonoHitSignal_, MonoHitSigX_, MonoHitSigY_, MonoHitTheta_, MonoHitWidth_, MonoHitX_, MonoHitY_, MonoHitZ_, MonoLayer_, myTree_, NMatchedHits_, NMonoHits_, NShowers_, NStereoHits_, StereoDetector_, StereoHitCorr_, StereoHitNoise_, StereoHitPhi_, StereoHitR_, StereoHitSignal_, StereoHitSigX_, StereoHitSigY_, StereoHitTheta_, StereoHitWidth_, StereoHitX_, StereoHitY_, StereoHitZ_, StereoLayer_, XShower_, YShower_, and ZShower_.

301  {
302  myTree_ = new TTree("myTree", "my first Tree example");
303 
304  myTree_->Branch("NShowers", &NShowers_, "NShowers/I");
305 
306  // first specify the ECAL clusters
307  // need to explicitly include array length.
308  myTree_->Branch("EShower", &EShower_, "EShower[1000]/F");
309  myTree_->Branch("XShower", &XShower_, "XShower[1000]/F");
310  myTree_->Branch("YShower", &YShower_, "YShower[1000]/F");
311  myTree_->Branch("ZShower", &ZShower_, "ZShower[1000]/F");
312 
313  // second specify the Si Stereo Hits
314  myTree_->Branch("NStereoHits", &NStereoHits_, "NStereoHits/I");
315  myTree_->Branch("StereoHitX", &StereoHitX_, "StereoHitX[1000]/F");
316  myTree_->Branch("StereoHitY", &StereoHitY_, "StereoHitY[1000]/F");
317  myTree_->Branch("StereoHitZ", &StereoHitZ_, "StereoHitZ[1000]/F");
318 
319  myTree_->Branch("StereoHitR", &StereoHitR_, "StereoHitR[1000]/F");
320  myTree_->Branch("StereoHitPhi", &StereoHitPhi_, "StereoHitPhi[1000]/F");
321  myTree_->Branch("StereoHitTheta", &StereoHitTheta_, "StereoHitTheta[1000]/F");
322 
323  myTree_->Branch("StereoHitSigX", &StereoHitSigX_, "StereoHitSigX[1000]/F");
324  myTree_->Branch("StereoHitSigY", &StereoHitSigY_, "StereoHitSigY[1000]/F");
325  myTree_->Branch("StereoHitCorr", &StereoHitCorr_, "StereoHitCorr[1000]/F");
326 
327  myTree_->Branch("StereoHitSignal", &StereoHitSignal_, "StereoHitSignal[1000]/F");
328  myTree_->Branch("StereoHitNoise", &StereoHitNoise_, "StereoHitNoise[1000]/F");
329  myTree_->Branch("StereoHitWidth", &StereoHitWidth_, "StereoHitWidth[1000]/I");
330 
331  myTree_->Branch("StereoDetector", &StereoDetector_, "StereoDetector[1000]/I");
332  myTree_->Branch("StereoLayer", &StereoLayer_, "StereoLayer[1000]/I");
333 
334  // specify the Si mono (rphi) hits
335  myTree_->Branch("NMonoHits", &NMonoHits_, "NMonoHits/I");
336  myTree_->Branch("MonoHitX", &MonoHitX_, "MonoHitX[1000]/F");
337  myTree_->Branch("MonoHitY", &MonoHitY_, "MonoHitY[1000]/F");
338  myTree_->Branch("MonoHitZ", &MonoHitZ_, "MonoHitZ[1000]/F");
339 
340  myTree_->Branch("MonoHitR", &MonoHitR_, "MonoHitR[1000]/F");
341  myTree_->Branch("MonoHitPhi", &MonoHitPhi_, "MonoHitPhi[1000]/F");
342  myTree_->Branch("MonoHitTheta", &MonoHitTheta_, "MonoHitTheta[1000]/F");
343 
344  myTree_->Branch("MonoHitSigX", &MonoHitSigX_, "MonoHitSigX[1000]/F");
345  myTree_->Branch("MonoHitSigY", &MonoHitSigY_, "MonoHitSigY[1000]/F");
346  myTree_->Branch("MonoHitCorr", &MonoHitCorr_, "MonoHitCorr[1000]/F");
347 
348  myTree_->Branch("MonoHitSignal", &MonoHitSignal_, "MonoHitSignal[1000]/F");
349  myTree_->Branch("MonoHitNoise", &MonoHitNoise_, "MonoHitNoise[1000]/F");
350  myTree_->Branch("MonoHitWidth", &MonoHitWidth_, "MonoHitWidth[1000]/I");
351 
352  myTree_->Branch("MonoDetector", &MonoDetector_, "MonoDetector[1000]/I");
353  myTree_->Branch("MonoLayer", &MonoLayer_, "MonoLayer[1000]/I");
354 
355  // specify the Si matched (rphi) hits
356  myTree_->Branch("NMatchedHits", &NMatchedHits_, "NMatchedHits/I");
357  myTree_->Branch("MatchedHitX", &MatchedHitX_, "MatchedHitX[1000]/F");
358  myTree_->Branch("MatchedHitY", &MatchedHitY_, "MatchedHitY[1000]/F");
359  myTree_->Branch("MatchedHitZ", &MatchedHitZ_, "MatchedHitZ[1000]/F");
360 
361  myTree_->Branch("MatchedHitR", &MatchedHitR_, "MatchedHitR[1000]/F");
362  myTree_->Branch("MatchedHitPhi", &MatchedHitPhi_, "MatchedHitPhi[1000]/F");
363  myTree_->Branch("MatchedHitTheta", &MatchedHitTheta_, "MatchedHitTheta[1000]/F");
364 
365  myTree_->Branch("MatchedHitSigX", &MatchedHitSigX_, "MatchedHitSigX[1000]/F");
366  myTree_->Branch("MatchedHitSigY", &MatchedHitSigY_, "MatchedHitSigY[1000]/F");
367  myTree_->Branch("MatchedHitCorr", &MatchedHitCorr_, "MatchedHitCorr[1000]/F");
368 
369  myTree_->Branch("MatchedHitSignal", &MatchedHitSignal_, "MatchedHitSignal[1000]/F");
370  myTree_->Branch("MatchedHitNoise", &MatchedHitNoise_, "MatchedHitNoise[1000]/F");
371  myTree_->Branch("MatchedHitWidth", &MatchedHitWidth_, "MatchedHitWidth[1000]/I");
372 
373  myTree_->Branch("MatchedDetector", &MatchedDetector_, "MatchedDetector[1000]/I");
374  myTree_->Branch("MatchedLayer", &MatchedLayer_, "MatchedLayer[1000]/I");
375 }
void SiStripElectronAnalyzer::endJob ( void  )
overridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 1293 of file SiStripElectronAnalyzer.cc.

References emaxSuperClusters_, emaxSuperClustersEl_, energySuperClusters_, energySuperClustersEl_, file_, LogDebug, myTree_, numCand_, numElectrons_, numSiMatchedHits_, numSiMonoHits_, numSiStereoHits_, numSuperClusters_, pDiff, pElectronFailed, pElectronPassed, phiWidthSuperClusters_, phiWidthSuperClustersEl_, ptDiff, ptElectronFailed, ptElectronPassed, sizeSuperClusters_, sizeSuperClustersEl_, sizeSuperClustersFailed, and sizeSuperClustersPassed.

1293  {
1294  LogDebug("") << "Entering endJob ";
1295  file_->cd();
1296  numCand_->Write();
1297  numElectrons_->Write();
1298  numSuperClusters_->Write();
1299 
1300  energySuperClusters_->Write();
1301  sizeSuperClusters_->Write();
1302  emaxSuperClusters_->Write();
1303  phiWidthSuperClusters_->Write();
1304 
1305  energySuperClustersEl_->Write();
1306  sizeSuperClustersEl_->Write();
1307  emaxSuperClustersEl_->Write();
1308  phiWidthSuperClustersEl_->Write();
1309 
1310  ptDiff->Write();
1311  pDiff->Write();
1312  pElectronFailed->Write();
1313  ptElectronFailed->Write();
1314  pElectronPassed->Write();
1315  ptElectronPassed->Write();
1316  sizeSuperClustersPassed->Write();
1317  sizeSuperClustersFailed->Write();
1318  // energySuperClustersPassed->Write();
1319  // energySuperClustersFailed->Write();
1320  // eOverPPassed->Write();
1321  // eOverPFailed->Write();
1322 
1323  numSiStereoHits_->Write();
1324  numSiMonoHits_->Write();
1325  numSiMatchedHits_->Write();
1326 
1327  // disable for large dataset
1328  LogDebug("") << " Writing out ntuple is disabled for now ";
1329  myTree_->Write();
1330 
1331  file_->Close();
1332 }
#define LogDebug(id)
void SiStripElectronAnalyzer::initNtuple ( void  )
virtual

Definition at line 377 of file SiStripElectronAnalyzer.cc.

References EShower_, init, LogDebug, MatchedHitNoise_, MatchedHitPhi_, MatchedHitR_, MatchedHitSignal_, MatchedHitTheta_, MatchedHitWidth_, MatchedHitX_, MatchedHitY_, MatchedHitZ_, MonoHitNoise_, MonoHitPhi_, MonoHitR_, MonoHitSignal_, MonoHitTheta_, MonoHitWidth_, MonoHitX_, MonoHitY_, MonoHitZ_, myMaxHits, NMatchedHits_, NMonoHits_, NShowers_, NStereoHits_, StereoHitNoise_, StereoHitPhi_, StereoHitR_, StereoHitSignal_, StereoHitTheta_, StereoHitWidth_, StereoHitX_, StereoHitY_, StereoHitZ_, XShower_, YShower_, and ZShower_.

Referenced by analyze().

377  {
378  LogDebug("") << " In initNtuple ";
379 
380  NShowers_ = -999;
381  for (int init = 0; init < myMaxHits; ++init) {
382  EShower_[init] = -999.;
383  XShower_[init] = -999.;
384  YShower_[init] = -999.;
385  ZShower_[init] = -999.;
386  }
387  NStereoHits_ = -999;
388 
389  for (int init = 0; init < myMaxHits; ++init) {
390  StereoHitX_[init] = -999.;
391  StereoHitY_[init] = -999.;
392  StereoHitZ_[init] = -999.;
393  StereoHitR_[init] = -999.;
394  StereoHitPhi_[init] = -999.;
395  StereoHitTheta_[init] = -999.;
396 
397  StereoHitSignal_[init] = -999.;
398  StereoHitNoise_[init] = -999.;
399  StereoHitWidth_[init] = -999;
400  ;
401  }
402 
403  NMonoHits_ = -999;
404  for (int init = 0; init < myMaxHits; ++init) {
405  MonoHitX_[init] = -999.;
406  MonoHitY_[init] = -999.;
407  MonoHitZ_[init] = -999.;
408  MonoHitR_[init] = -999.;
409  MonoHitPhi_[init] = -999.;
410  MonoHitTheta_[init] = -999.;
411 
412  MonoHitSignal_[init] = -999.;
413  MonoHitNoise_[init] = -999.;
414  MonoHitWidth_[init] = -999;
415  ;
416  }
417 
418  NMatchedHits_ = -999;
419  for (int init = 0; init < myMaxHits; ++init) {
420  MatchedHitX_[init] = -999.;
421  MatchedHitY_[init] = -999.;
422  MatchedHitZ_[init] = -999.;
423  MatchedHitR_[init] = -999.;
424  MatchedHitPhi_[init] = -999.;
425  MatchedHitTheta_[init] = -999.;
426 
427  MatchedHitSignal_[init] = -999.;
428  MatchedHitNoise_[init] = -999.;
429  MatchedHitWidth_[init] = -999;
430  ;
431  }
432 }
#define myMaxHits
int init
Definition: HydjetWrapper.h:64
#define LogDebug(id)
double SiStripElectronAnalyzer::unwrapPhi ( double  phi) const
inlineprivate

Definition at line 68 of file SiStripElectronAnalyzer.cc.

References M_PI, and phi.

68  {
69  while (phi > M_PI) {
70  phi -= 2. * M_PI;
71  }
72  while (phi < -M_PI) {
73  phi += 2. * M_PI;
74  }
75  return phi;
76  }
#define M_PI

Member Data Documentation

std::string SiStripElectronAnalyzer::basicClusterCollection_
private

Definition at line 190 of file SiStripElectronAnalyzer.cc.

std::string SiStripElectronAnalyzer::basicClusterProducer_
private

Definition at line 189 of file SiStripElectronAnalyzer.cc.

std::string SiStripElectronAnalyzer::eBRecHitCollection_
private

Definition at line 192 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and SiStripElectronAnalyzer().

std::string SiStripElectronAnalyzer::eBRecHitProducer_
private

Definition at line 191 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and SiStripElectronAnalyzer().

std::string SiStripElectronAnalyzer::electronCollection_
private

Definition at line 196 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and SiStripElectronAnalyzer().

std::string SiStripElectronAnalyzer::electronProducer_
private

Definition at line 195 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and SiStripElectronAnalyzer().

TH1F* SiStripElectronAnalyzer::emaxSuperClusters_
private

Definition at line 87 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), endJob(), and SiStripElectronAnalyzer().

TH1F* SiStripElectronAnalyzer::emaxSuperClustersEl_
private

Definition at line 92 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), endJob(), and SiStripElectronAnalyzer().

TH1F* SiStripElectronAnalyzer::energySuperClusters_
private

Definition at line 85 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), endJob(), and SiStripElectronAnalyzer().

TH1F* SiStripElectronAnalyzer::energySuperClustersEl_
private

Definition at line 90 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), endJob(), and SiStripElectronAnalyzer().

TH1F* SiStripElectronAnalyzer::energySuperClustersFailed
private

Definition at line 104 of file SiStripElectronAnalyzer.cc.

Referenced by SiStripElectronAnalyzer().

TH1F* SiStripElectronAnalyzer::energySuperClustersPassed
private

Definition at line 103 of file SiStripElectronAnalyzer.cc.

Referenced by SiStripElectronAnalyzer().

TH1F* SiStripElectronAnalyzer::eOverPFailed
private

Definition at line 105 of file SiStripElectronAnalyzer.cc.

Referenced by SiStripElectronAnalyzer().

TH1F* SiStripElectronAnalyzer::eOverPPassed
private

Definition at line 106 of file SiStripElectronAnalyzer.cc.

Referenced by SiStripElectronAnalyzer().

float SiStripElectronAnalyzer::EShower_[1000]
private

Definition at line 115 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

TFile* SiStripElectronAnalyzer::file_
private
std::string SiStripElectronAnalyzer::fileName_
private

Definition at line 79 of file SiStripElectronAnalyzer.cc.

Referenced by SiStripElectronAnalyzer().

int SiStripElectronAnalyzer::MatchedDetector_[1000]
private

Definition at line 182 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

float SiStripElectronAnalyzer::MatchedHitCorr_[1000]
private

Definition at line 176 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

float SiStripElectronAnalyzer::MatchedHitNoise_[1000]
private

Definition at line 179 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

float SiStripElectronAnalyzer::MatchedHitPhi_[1000]
private

Definition at line 170 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

float SiStripElectronAnalyzer::MatchedHitR_[1000]
private

Definition at line 169 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

float SiStripElectronAnalyzer::MatchedHitSignal_[1000]
private

Definition at line 178 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

float SiStripElectronAnalyzer::MatchedHitSigX_[1000]
private

Definition at line 174 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

float SiStripElectronAnalyzer::MatchedHitSigY_[1000]
private

Definition at line 175 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

float SiStripElectronAnalyzer::MatchedHitTheta_[1000]
private

Definition at line 171 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

int SiStripElectronAnalyzer::MatchedHitWidth_[1000]
private

Definition at line 180 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

float SiStripElectronAnalyzer::MatchedHitX_[1000]
private

Definition at line 165 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

float SiStripElectronAnalyzer::MatchedHitY_[1000]
private

Definition at line 166 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

float SiStripElectronAnalyzer::MatchedHitZ_[1000]
private

Definition at line 167 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

int SiStripElectronAnalyzer::MatchedLayer_[1000]
private

Definition at line 183 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

std::string SiStripElectronAnalyzer::mctruthCollection_
private

Definition at line 186 of file SiStripElectronAnalyzer.cc.

Referenced by SiStripElectronAnalyzer().

std::string SiStripElectronAnalyzer::mctruthProducer_
private

Definition at line 185 of file SiStripElectronAnalyzer.cc.

Referenced by SiStripElectronAnalyzer().

int SiStripElectronAnalyzer::MonoDetector_[1000]
private

Definition at line 160 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

float SiStripElectronAnalyzer::MonoHitCorr_[1000]
private

Definition at line 154 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

float SiStripElectronAnalyzer::MonoHitNoise_[1000]
private

Definition at line 157 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

float SiStripElectronAnalyzer::MonoHitPhi_[1000]
private

Definition at line 148 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

float SiStripElectronAnalyzer::MonoHitR_[1000]
private

Definition at line 147 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

float SiStripElectronAnalyzer::MonoHitSignal_[1000]
private

Definition at line 156 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

float SiStripElectronAnalyzer::MonoHitSigX_[1000]
private

Definition at line 152 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

float SiStripElectronAnalyzer::MonoHitSigY_[1000]
private

Definition at line 153 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

float SiStripElectronAnalyzer::MonoHitTheta_[1000]
private

Definition at line 149 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

int SiStripElectronAnalyzer::MonoHitWidth_[1000]
private

Definition at line 158 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

float SiStripElectronAnalyzer::MonoHitX_[1000]
private

Definition at line 143 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

float SiStripElectronAnalyzer::MonoHitY_[1000]
private

Definition at line 144 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

float SiStripElectronAnalyzer::MonoHitZ_[1000]
private

Definition at line 145 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

int SiStripElectronAnalyzer::MonoLayer_[1000]
private

Definition at line 161 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

TTree* SiStripElectronAnalyzer::myTree_
private

Definition at line 112 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and endJob().

int SiStripElectronAnalyzer::NMatchedHits_
private

Definition at line 164 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

int SiStripElectronAnalyzer::NMonoHits_
private

Definition at line 142 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

int SiStripElectronAnalyzer::NShowers_
private

Definition at line 114 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

int SiStripElectronAnalyzer::NStereoHits_
private

Definition at line 120 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

TH1F* SiStripElectronAnalyzer::numCand_
private

Definition at line 82 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), endJob(), and SiStripElectronAnalyzer().

TH1F* SiStripElectronAnalyzer::numElectrons_
private

Definition at line 83 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), endJob(), and SiStripElectronAnalyzer().

TH1F* SiStripElectronAnalyzer::numSiMatchedHits_
private

Definition at line 110 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), endJob(), and SiStripElectronAnalyzer().

TH1F* SiStripElectronAnalyzer::numSiMonoHits_
private

Definition at line 109 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), endJob(), and SiStripElectronAnalyzer().

TH1F* SiStripElectronAnalyzer::numSiStereoHits_
private

Definition at line 108 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), endJob(), and SiStripElectronAnalyzer().

TH1F* SiStripElectronAnalyzer::numSuperClusters_
private

Definition at line 84 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), endJob(), and SiStripElectronAnalyzer().

TH1F* SiStripElectronAnalyzer::pDiff
private

Definition at line 96 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), endJob(), and SiStripElectronAnalyzer().

TH1F* SiStripElectronAnalyzer::pElectronFailed
private

Definition at line 97 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), endJob(), and SiStripElectronAnalyzer().

TH1F* SiStripElectronAnalyzer::pElectronPassed
private

Definition at line 99 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), endJob(), and SiStripElectronAnalyzer().

TH1F* SiStripElectronAnalyzer::phiWidthSuperClusters_
private

Definition at line 88 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), endJob(), and SiStripElectronAnalyzer().

TH1F* SiStripElectronAnalyzer::phiWidthSuperClustersEl_
private

Definition at line 93 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), endJob(), and SiStripElectronAnalyzer().

TH1F* SiStripElectronAnalyzer::ptDiff
private

Definition at line 95 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), endJob(), and SiStripElectronAnalyzer().

TH1F* SiStripElectronAnalyzer::ptElectronFailed
private

Definition at line 98 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), endJob(), and SiStripElectronAnalyzer().

TH1F* SiStripElectronAnalyzer::ptElectronPassed
private

Definition at line 100 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), endJob(), and SiStripElectronAnalyzer().

std::string SiStripElectronAnalyzer::siElectronCollection_
private

Definition at line 194 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and SiStripElectronAnalyzer().

std::string SiStripElectronAnalyzer::siElectronProducer_
private

Definition at line 193 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and SiStripElectronAnalyzer().

std::string SiStripElectronAnalyzer::siHitProducer_
private

Definition at line 197 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and SiStripElectronAnalyzer().

std::string SiStripElectronAnalyzer::siMatchedHitCollection_
private

Definition at line 200 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and SiStripElectronAnalyzer().

std::string SiStripElectronAnalyzer::siRphiHitCollection_
private

Definition at line 198 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and SiStripElectronAnalyzer().

std::string SiStripElectronAnalyzer::siStereoHitCollection_
private

Definition at line 199 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and SiStripElectronAnalyzer().

TH1F* SiStripElectronAnalyzer::sizeSuperClusters_
private

Definition at line 86 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), endJob(), and SiStripElectronAnalyzer().

TH1F* SiStripElectronAnalyzer::sizeSuperClustersEl_
private

Definition at line 91 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), endJob(), and SiStripElectronAnalyzer().

TH1F* SiStripElectronAnalyzer::sizeSuperClustersFailed
private

Definition at line 102 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), endJob(), and SiStripElectronAnalyzer().

TH1F* SiStripElectronAnalyzer::sizeSuperClustersPassed
private

Definition at line 101 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), endJob(), and SiStripElectronAnalyzer().

int SiStripElectronAnalyzer::StereoDetector_[1000]
private

Definition at line 138 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

float SiStripElectronAnalyzer::StereoHitCorr_[1000]
private

Definition at line 132 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

float SiStripElectronAnalyzer::StereoHitNoise_[1000]
private

Definition at line 135 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

float SiStripElectronAnalyzer::StereoHitPhi_[1000]
private

Definition at line 126 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

float SiStripElectronAnalyzer::StereoHitR_[1000]
private

Definition at line 125 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

float SiStripElectronAnalyzer::StereoHitSignal_[1000]
private

Definition at line 134 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

float SiStripElectronAnalyzer::StereoHitSigX_[1000]
private

Definition at line 130 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

float SiStripElectronAnalyzer::StereoHitSigY_[1000]
private

Definition at line 131 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

float SiStripElectronAnalyzer::StereoHitTheta_[1000]
private

Definition at line 127 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

int SiStripElectronAnalyzer::StereoHitWidth_[1000]
private

Definition at line 136 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

float SiStripElectronAnalyzer::StereoHitX_[1000]
private

Definition at line 121 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

float SiStripElectronAnalyzer::StereoHitY_[1000]
private

Definition at line 122 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

float SiStripElectronAnalyzer::StereoHitZ_[1000]
private

Definition at line 123 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

int SiStripElectronAnalyzer::StereoLayer_[1000]
private

Definition at line 139 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

std::string SiStripElectronAnalyzer::superClusterCollection_
private

Definition at line 188 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and SiStripElectronAnalyzer().

std::string SiStripElectronAnalyzer::superClusterProducer_
private

Definition at line 187 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and SiStripElectronAnalyzer().

float SiStripElectronAnalyzer::XShower_[1000]
private

Definition at line 116 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

float SiStripElectronAnalyzer::YShower_[1000]
private

Definition at line 117 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().

float SiStripElectronAnalyzer::ZShower_[1000]
private

Definition at line 118 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), beginJob(), and initNtuple().