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_
 
const edm::ESGetToken
< TrackerTopology,
TrackerTopologyRcd
topoToken_
 
const edm::ESGetToken
< TrackerGeometry,
TrackerDigiGeometryRecord
trackerToken_
 
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< Bconsumes (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 ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
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 209 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_.

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

Definition at line 281 of file SiStripElectronAnalyzer.cc.

References file_.

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

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 439 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::Event::getByLabel(), edm::EventSetup::getHandle(), 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, topoToken_, trackerToken_, 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_.

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

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

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 1295 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.

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

Definition at line 381 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().

381  {
382  LogDebug("") << " In initNtuple ";
383 
384  NShowers_ = -999;
385  for (int init = 0; init < myMaxHits; ++init) {
386  EShower_[init] = -999.;
387  XShower_[init] = -999.;
388  YShower_[init] = -999.;
389  ZShower_[init] = -999.;
390  }
391  NStereoHits_ = -999;
392 
393  for (int init = 0; init < myMaxHits; ++init) {
394  StereoHitX_[init] = -999.;
395  StereoHitY_[init] = -999.;
396  StereoHitZ_[init] = -999.;
397  StereoHitR_[init] = -999.;
398  StereoHitPhi_[init] = -999.;
399  StereoHitTheta_[init] = -999.;
400 
401  StereoHitSignal_[init] = -999.;
402  StereoHitNoise_[init] = -999.;
403  StereoHitWidth_[init] = -999;
404  ;
405  }
406 
407  NMonoHits_ = -999;
408  for (int init = 0; init < myMaxHits; ++init) {
409  MonoHitX_[init] = -999.;
410  MonoHitY_[init] = -999.;
411  MonoHitZ_[init] = -999.;
412  MonoHitR_[init] = -999.;
413  MonoHitPhi_[init] = -999.;
414  MonoHitTheta_[init] = -999.;
415 
416  MonoHitSignal_[init] = -999.;
417  MonoHitNoise_[init] = -999.;
418  MonoHitWidth_[init] = -999;
419  ;
420  }
421 
422  NMatchedHits_ = -999;
423  for (int init = 0; init < myMaxHits; ++init) {
424  MatchedHitX_[init] = -999.;
425  MatchedHitY_[init] = -999.;
426  MatchedHitZ_[init] = -999.;
427  MatchedHitR_[init] = -999.;
428  MatchedHitPhi_[init] = -999.;
429  MatchedHitTheta_[init] = -999.;
430 
431  MatchedHitSignal_[init] = -999.;
432  MatchedHitNoise_[init] = -999.;
433  MatchedHitWidth_[init] = -999;
434  ;
435  }
436 }
#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 193 of file SiStripElectronAnalyzer.cc.

std::string SiStripElectronAnalyzer::basicClusterProducer_
private

Definition at line 192 of file SiStripElectronAnalyzer.cc.

std::string SiStripElectronAnalyzer::eBRecHitCollection_
private

Definition at line 195 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and SiStripElectronAnalyzer().

std::string SiStripElectronAnalyzer::eBRecHitProducer_
private

Definition at line 194 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and SiStripElectronAnalyzer().

std::string SiStripElectronAnalyzer::electronCollection_
private

Definition at line 199 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and SiStripElectronAnalyzer().

std::string SiStripElectronAnalyzer::electronProducer_
private

Definition at line 198 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and SiStripElectronAnalyzer().

TH1F* SiStripElectronAnalyzer::emaxSuperClusters_
private

Definition at line 90 of file SiStripElectronAnalyzer.cc.

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

TH1F* SiStripElectronAnalyzer::emaxSuperClustersEl_
private

Definition at line 95 of file SiStripElectronAnalyzer.cc.

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

TH1F* SiStripElectronAnalyzer::energySuperClusters_
private

Definition at line 88 of file SiStripElectronAnalyzer.cc.

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

TH1F* SiStripElectronAnalyzer::energySuperClustersEl_
private

Definition at line 93 of file SiStripElectronAnalyzer.cc.

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

TH1F* SiStripElectronAnalyzer::energySuperClustersFailed
private

Definition at line 107 of file SiStripElectronAnalyzer.cc.

Referenced by SiStripElectronAnalyzer().

TH1F* SiStripElectronAnalyzer::energySuperClustersPassed
private

Definition at line 106 of file SiStripElectronAnalyzer.cc.

Referenced by SiStripElectronAnalyzer().

TH1F* SiStripElectronAnalyzer::eOverPFailed
private

Definition at line 108 of file SiStripElectronAnalyzer.cc.

Referenced by SiStripElectronAnalyzer().

TH1F* SiStripElectronAnalyzer::eOverPPassed
private

Definition at line 109 of file SiStripElectronAnalyzer.cc.

Referenced by SiStripElectronAnalyzer().

float SiStripElectronAnalyzer::EShower_[1000]
private

Definition at line 118 of file SiStripElectronAnalyzer.cc.

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

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

Definition at line 82 of file SiStripElectronAnalyzer.cc.

Referenced by SiStripElectronAnalyzer().

int SiStripElectronAnalyzer::MatchedDetector_[1000]
private

Definition at line 185 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

float SiStripElectronAnalyzer::MatchedHitCorr_[1000]
private

Definition at line 179 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

float SiStripElectronAnalyzer::MatchedHitNoise_[1000]
private

Definition at line 182 of file SiStripElectronAnalyzer.cc.

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

float SiStripElectronAnalyzer::MatchedHitPhi_[1000]
private

Definition at line 173 of file SiStripElectronAnalyzer.cc.

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

float SiStripElectronAnalyzer::MatchedHitR_[1000]
private

Definition at line 172 of file SiStripElectronAnalyzer.cc.

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

float SiStripElectronAnalyzer::MatchedHitSignal_[1000]
private

Definition at line 181 of file SiStripElectronAnalyzer.cc.

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

float SiStripElectronAnalyzer::MatchedHitSigX_[1000]
private

Definition at line 177 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

float SiStripElectronAnalyzer::MatchedHitSigY_[1000]
private

Definition at line 178 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

float SiStripElectronAnalyzer::MatchedHitTheta_[1000]
private

Definition at line 174 of file SiStripElectronAnalyzer.cc.

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

int SiStripElectronAnalyzer::MatchedHitWidth_[1000]
private

Definition at line 183 of file SiStripElectronAnalyzer.cc.

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

float SiStripElectronAnalyzer::MatchedHitX_[1000]
private

Definition at line 168 of file SiStripElectronAnalyzer.cc.

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

float SiStripElectronAnalyzer::MatchedHitY_[1000]
private

Definition at line 169 of file SiStripElectronAnalyzer.cc.

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

float SiStripElectronAnalyzer::MatchedHitZ_[1000]
private

Definition at line 170 of file SiStripElectronAnalyzer.cc.

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

int SiStripElectronAnalyzer::MatchedLayer_[1000]
private

Definition at line 186 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

std::string SiStripElectronAnalyzer::mctruthCollection_
private

Definition at line 189 of file SiStripElectronAnalyzer.cc.

Referenced by SiStripElectronAnalyzer().

std::string SiStripElectronAnalyzer::mctruthProducer_
private

Definition at line 188 of file SiStripElectronAnalyzer.cc.

Referenced by SiStripElectronAnalyzer().

int SiStripElectronAnalyzer::MonoDetector_[1000]
private

Definition at line 163 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

float SiStripElectronAnalyzer::MonoHitCorr_[1000]
private

Definition at line 157 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

float SiStripElectronAnalyzer::MonoHitNoise_[1000]
private

Definition at line 160 of file SiStripElectronAnalyzer.cc.

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

float SiStripElectronAnalyzer::MonoHitPhi_[1000]
private

Definition at line 151 of file SiStripElectronAnalyzer.cc.

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

float SiStripElectronAnalyzer::MonoHitR_[1000]
private

Definition at line 150 of file SiStripElectronAnalyzer.cc.

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

float SiStripElectronAnalyzer::MonoHitSignal_[1000]
private

Definition at line 159 of file SiStripElectronAnalyzer.cc.

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

float SiStripElectronAnalyzer::MonoHitSigX_[1000]
private

Definition at line 155 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

float SiStripElectronAnalyzer::MonoHitSigY_[1000]
private

Definition at line 156 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

float SiStripElectronAnalyzer::MonoHitTheta_[1000]
private

Definition at line 152 of file SiStripElectronAnalyzer.cc.

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

int SiStripElectronAnalyzer::MonoHitWidth_[1000]
private

Definition at line 161 of file SiStripElectronAnalyzer.cc.

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

float SiStripElectronAnalyzer::MonoHitX_[1000]
private

Definition at line 146 of file SiStripElectronAnalyzer.cc.

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

float SiStripElectronAnalyzer::MonoHitY_[1000]
private

Definition at line 147 of file SiStripElectronAnalyzer.cc.

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

float SiStripElectronAnalyzer::MonoHitZ_[1000]
private

Definition at line 148 of file SiStripElectronAnalyzer.cc.

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

int SiStripElectronAnalyzer::MonoLayer_[1000]
private

Definition at line 164 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

TTree* SiStripElectronAnalyzer::myTree_
private

Definition at line 115 of file SiStripElectronAnalyzer.cc.

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

int SiStripElectronAnalyzer::NMatchedHits_
private

Definition at line 167 of file SiStripElectronAnalyzer.cc.

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

int SiStripElectronAnalyzer::NMonoHits_
private

Definition at line 145 of file SiStripElectronAnalyzer.cc.

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

int SiStripElectronAnalyzer::NShowers_
private

Definition at line 117 of file SiStripElectronAnalyzer.cc.

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

int SiStripElectronAnalyzer::NStereoHits_
private

Definition at line 123 of file SiStripElectronAnalyzer.cc.

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

TH1F* SiStripElectronAnalyzer::numCand_
private

Definition at line 85 of file SiStripElectronAnalyzer.cc.

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

TH1F* SiStripElectronAnalyzer::numElectrons_
private

Definition at line 86 of file SiStripElectronAnalyzer.cc.

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

TH1F* SiStripElectronAnalyzer::numSiMatchedHits_
private

Definition at line 113 of file SiStripElectronAnalyzer.cc.

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

TH1F* SiStripElectronAnalyzer::numSiMonoHits_
private

Definition at line 112 of file SiStripElectronAnalyzer.cc.

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

TH1F* SiStripElectronAnalyzer::numSiStereoHits_
private

Definition at line 111 of file SiStripElectronAnalyzer.cc.

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

TH1F* SiStripElectronAnalyzer::numSuperClusters_
private

Definition at line 87 of file SiStripElectronAnalyzer.cc.

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

TH1F* SiStripElectronAnalyzer::pDiff
private

Definition at line 99 of file SiStripElectronAnalyzer.cc.

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

TH1F* SiStripElectronAnalyzer::pElectronFailed
private

Definition at line 100 of file SiStripElectronAnalyzer.cc.

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

TH1F* SiStripElectronAnalyzer::pElectronPassed
private

Definition at line 102 of file SiStripElectronAnalyzer.cc.

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

TH1F* SiStripElectronAnalyzer::phiWidthSuperClusters_
private

Definition at line 91 of file SiStripElectronAnalyzer.cc.

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

TH1F* SiStripElectronAnalyzer::phiWidthSuperClustersEl_
private

Definition at line 96 of file SiStripElectronAnalyzer.cc.

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

TH1F* SiStripElectronAnalyzer::ptDiff
private

Definition at line 98 of file SiStripElectronAnalyzer.cc.

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

TH1F* SiStripElectronAnalyzer::ptElectronFailed
private

Definition at line 101 of file SiStripElectronAnalyzer.cc.

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

TH1F* SiStripElectronAnalyzer::ptElectronPassed
private

Definition at line 103 of file SiStripElectronAnalyzer.cc.

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

std::string SiStripElectronAnalyzer::siElectronCollection_
private

Definition at line 197 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and SiStripElectronAnalyzer().

std::string SiStripElectronAnalyzer::siElectronProducer_
private

Definition at line 196 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and SiStripElectronAnalyzer().

std::string SiStripElectronAnalyzer::siHitProducer_
private

Definition at line 200 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and SiStripElectronAnalyzer().

std::string SiStripElectronAnalyzer::siMatchedHitCollection_
private

Definition at line 203 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and SiStripElectronAnalyzer().

std::string SiStripElectronAnalyzer::siRphiHitCollection_
private

Definition at line 201 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and SiStripElectronAnalyzer().

std::string SiStripElectronAnalyzer::siStereoHitCollection_
private

Definition at line 202 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and SiStripElectronAnalyzer().

TH1F* SiStripElectronAnalyzer::sizeSuperClusters_
private

Definition at line 89 of file SiStripElectronAnalyzer.cc.

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

TH1F* SiStripElectronAnalyzer::sizeSuperClustersEl_
private

Definition at line 94 of file SiStripElectronAnalyzer.cc.

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

TH1F* SiStripElectronAnalyzer::sizeSuperClustersFailed
private

Definition at line 105 of file SiStripElectronAnalyzer.cc.

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

TH1F* SiStripElectronAnalyzer::sizeSuperClustersPassed
private

Definition at line 104 of file SiStripElectronAnalyzer.cc.

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

int SiStripElectronAnalyzer::StereoDetector_[1000]
private

Definition at line 141 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

float SiStripElectronAnalyzer::StereoHitCorr_[1000]
private

Definition at line 135 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

float SiStripElectronAnalyzer::StereoHitNoise_[1000]
private

Definition at line 138 of file SiStripElectronAnalyzer.cc.

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

float SiStripElectronAnalyzer::StereoHitPhi_[1000]
private

Definition at line 129 of file SiStripElectronAnalyzer.cc.

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

float SiStripElectronAnalyzer::StereoHitR_[1000]
private

Definition at line 128 of file SiStripElectronAnalyzer.cc.

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

float SiStripElectronAnalyzer::StereoHitSignal_[1000]
private

Definition at line 137 of file SiStripElectronAnalyzer.cc.

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

float SiStripElectronAnalyzer::StereoHitSigX_[1000]
private

Definition at line 133 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

float SiStripElectronAnalyzer::StereoHitSigY_[1000]
private

Definition at line 134 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

float SiStripElectronAnalyzer::StereoHitTheta_[1000]
private

Definition at line 130 of file SiStripElectronAnalyzer.cc.

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

int SiStripElectronAnalyzer::StereoHitWidth_[1000]
private

Definition at line 139 of file SiStripElectronAnalyzer.cc.

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

float SiStripElectronAnalyzer::StereoHitX_[1000]
private

Definition at line 124 of file SiStripElectronAnalyzer.cc.

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

float SiStripElectronAnalyzer::StereoHitY_[1000]
private

Definition at line 125 of file SiStripElectronAnalyzer.cc.

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

float SiStripElectronAnalyzer::StereoHitZ_[1000]
private

Definition at line 126 of file SiStripElectronAnalyzer.cc.

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

int SiStripElectronAnalyzer::StereoLayer_[1000]
private

Definition at line 142 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

std::string SiStripElectronAnalyzer::superClusterCollection_
private

Definition at line 191 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and SiStripElectronAnalyzer().

std::string SiStripElectronAnalyzer::superClusterProducer_
private

Definition at line 190 of file SiStripElectronAnalyzer.cc.

Referenced by analyze(), and SiStripElectronAnalyzer().

const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> SiStripElectronAnalyzer::topoToken_
private

Definition at line 79 of file SiStripElectronAnalyzer.cc.

Referenced by analyze().

const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> SiStripElectronAnalyzer::trackerToken_
private

Definition at line 80 of file SiStripElectronAnalyzer.cc.

Referenced by analyze().

float SiStripElectronAnalyzer::XShower_[1000]
private

Definition at line 119 of file SiStripElectronAnalyzer.cc.

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

float SiStripElectronAnalyzer::YShower_[1000]
private

Definition at line 120 of file SiStripElectronAnalyzer.cc.

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

float SiStripElectronAnalyzer::ZShower_[1000]
private

Definition at line 121 of file SiStripElectronAnalyzer.cc.

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