CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
HGCalTBAnalyzer Class Reference
Inheritance diagram for HGCalTBAnalyzer:
edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 HGCalTBAnalyzer (edm::ParameterSet const &)
 
 ~HGCalTBAnalyzer ()
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::SharedResources >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- 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
 
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::vector< ModuleDescription const * > &modules, 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 updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

virtual void analyze (edm::Event const &, edm::EventSetup const &) override
 
template<class T1 >
void analyzeDigi (int type, const T1 &detId, uint16_t adc)
 
void analyzePassiveHits (edm::Handle< edm::PassiveHitContainer > const &hgcPh, int subdet)
 
void analyzeRecHits (int type, edm::Handle< HGCRecHitCollection > &hits)
 
void analyzeSimHits (int type, std::vector< PCaloHit > &hits, double zFront)
 
void analyzeSimTracks (edm::Handle< edm::SimTrackContainer > const &SimTk, edm::Handle< edm::SimVertexContainer > const &SimVtx)
 
virtual void beginJob () override
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &) override
 
virtual void endRun (edm::Run const &, edm::EventSetup const &) override
 

Private Attributes

std::string detectorBeam_
 
std::string detectorBH_
 
std::string detectorEE_
 
std::string detectorFH_
 
bool doDigis_
 
bool doPassive_
 
bool doRecHits_
 
bool doSimHits_
 
bool doTree_
 
bool doTreeCell_
 
edm::Service< TFileServicefs_
 
TH1D * hBeam_
 
TH1D * hDigiADC_ [3]
 
TH1D * hDigiLng_ [2]
 
TH2D * hDigiOcc_ [3]
 
const HGCalDDDConstantshgcons_ [2]
 
std::vector< float > hgcPassiveBHEnergy_
 
std::vector< int > hgcPassiveBHID_
 
std::vector< std::string > hgcPassiveBHName_
 
std::vector< float > hgcPassiveCMSEEnergy_
 
std::vector< int > hgcPassiveCMSEID_
 
std::vector< std::string > hgcPassiveCMSEName_
 
std::vector< float > hgcPassiveEEEnergy_
 
std::vector< int > hgcPassiveEEID_
 
std::vector< std::string > hgcPassiveEEName_
 
std::vector< float > hgcPassiveFHEnergy_
 
std::vector< int > hgcPassiveFHID_
 
std::vector< std::string > hgcPassiveFHName_
 
const HGCalGeometryhgeom_ [2]
 
TH1D * hRecHitE_ [3]
 
TProfile2D * hRecHitLat_ [3]
 
TProfile * hRecHitLng1_ [3]
 
TProfile * hRecHitLng_ [3]
 
TH2D * hRecHitOcc_ [3]
 
TH1D * hSimHitE_ [4]
 
TH1D * hSimHitEn_ [4]
 
TProfile2D * hSimHitLat_ [3]
 
std::vector< TH1D * > hSimHitLayEn1BH_
 
std::vector< TH1D * > hSimHitLayEn1EE_
 
std::vector< TH1D * > hSimHitLayEn1FH_
 
std::vector< TH1D * > hSimHitLayEn2BH_
 
std::vector< TH1D * > hSimHitLayEn2EE_
 
std::vector< TH1D * > hSimHitLayEn2FH_
 
std::vector< TH1D * > hSimHitLayEnBeam_
 
TProfile * hSimHitLng1_ [3]
 
TProfile * hSimHitLng2_ [3]
 
TProfile * hSimHitLng_ [3]
 
TH1D * hSimHitT_ [4]
 
std::vector< int > idBeams_
 
bool ifBeam_
 
bool ifBH_
 
bool ifEE_
 
bool ifFH_
 
double pBeam_
 
int sampleIndex_
 
std::vector< float > simHitCellEnBeam_
 
std::vector< float > simHitCellEnBH_
 
std::vector< float > simHitCellEnEE_
 
std::vector< float > simHitCellEnFH_
 
std::vector< uint32_t > simHitCellIdBeam_
 
std::vector< uint32_t > simHitCellIdBH_
 
std::vector< uint32_t > simHitCellIdEE_
 
std::vector< uint32_t > simHitCellIdFH_
 
std::vector< float > simHitLayEn1BH_
 
std::vector< float > simHitLayEn1EE_
 
std::vector< float > simHitLayEn1FH_
 
std::vector< float > simHitLayEn2BH_
 
std::vector< float > simHitLayEn2EE_
 
std::vector< float > simHitLayEn2FH_
 
std::vector< float > simHitLayEnBeam_
 
edm::EDGetToken tok_digiBH_
 
edm::EDGetToken tok_digiEE_
 
edm::EDGetToken tok_digiFH_
 
edm::EDGetTokenT< edm::HepMCProducttok_hepMC_
 
edm::EDGetTokenT< edm::PassiveHitContainertok_hgcPHBH_
 
edm::EDGetTokenT< edm::PassiveHitContainertok_hgcPHCMSE_
 
edm::EDGetTokenT< edm::PassiveHitContainertok_hgcPHEE_
 
edm::EDGetTokenT< edm::PassiveHitContainertok_hgcPHFH_
 
edm::EDGetToken tok_hitrBH_
 
edm::EDGetToken tok_hitrEE_
 
edm::EDGetToken tok_hitrFH_
 
edm::EDGetTokenT< edm::PCaloHitContainertok_hitsBeam_
 
edm::EDGetTokenT< edm::PCaloHitContainertok_hitsBH_
 
edm::EDGetTokenT< edm::PCaloHitContainertok_hitsEE_
 
edm::EDGetTokenT< edm::PCaloHitContainertok_hitsFH_
 
edm::EDGetTokenT< edm::SimTrackContainertok_simTk_
 
edm::EDGetTokenT< edm::SimVertexContainertok_simVtx_
 
TTree * tree_
 
double xBeam_
 
double yBeam_
 
double zBeam_
 
double zFrontBH_
 
double zFrontEE_
 
double zFrontFH_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 55 of file HGCalTBAnalyzer.cc.

Constructor & Destructor Documentation

HGCalTBAnalyzer::HGCalTBAnalyzer ( edm::ParameterSet const &  )
explicit

Passive hits

Definition at line 127 of file HGCalTBAnalyzer.cc.

References gather_cfg::cout, detectorBeam_, detectorBH_, detectorEE_, detectorFH_, doDigis_, doPassive_, doRecHits_, doSimHits_, doTree_, doTreeCell_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), hcalTTPDigis_cfi::id, idBeams_, ifBeam_, ifBH_, ifEE_, ifFH_, sampleIndex_, AlCaHLTBitMon_QueryRunRegistry::string, tmp, tok_digiBH_, tok_digiEE_, tok_digiFH_, tok_hepMC_, tok_hgcPHBH_, tok_hgcPHCMSE_, tok_hgcPHEE_, tok_hgcPHFH_, tok_hitrBH_, tok_hitrEE_, tok_hitrFH_, tok_hitsBeam_, tok_hitsBH_, tok_hitsEE_, tok_hitsFH_, tok_simTk_, tok_simVtx_, zFrontBH_, zFrontEE_, and zFrontFH_.

127  {
128 
129  usesResource("TFileService");
130 
131  //now do whatever initialization is needed
132  detectorEE_ = iConfig.getParameter<std::string>("DetectorEE");
133  detectorFH_ = iConfig.getParameter<std::string>("DetectorFH");
134  detectorBH_ = iConfig.getParameter<std::string>("DetectorBH");
135  detectorBeam_= iConfig.getParameter<std::string>("DetectorBeam");
136  ifEE_ = iConfig.getParameter<bool>("UseEE");
137  ifFH_ = iConfig.getParameter<bool>("UseFH");
138  ifBH_ = iConfig.getParameter<bool>("UseBH");
139  ifBeam_ = iConfig.getParameter<bool>("UseBeam");
140  zFrontEE_ = iConfig.getParameter<double>("ZFrontEE");
141  zFrontFH_ = iConfig.getParameter<double>("ZFrontFH");
142  zFrontBH_ = iConfig.getParameter<double>("ZFrontBH");
143  idBeams_ = iConfig.getParameter<std::vector<int>>("IDBeams");
144  doSimHits_ = iConfig.getParameter<bool>("DoSimHits");
145  doDigis_ = iConfig.getParameter<bool>("DoDigis");
146  sampleIndex_ = iConfig.getParameter<int>("SampleIndex");
147  doRecHits_ = iConfig.getParameter<bool>("DoRecHits");
148  doTree_ = iConfig.getUntrackedParameter<bool>("DoTree",false);
149  doTreeCell_ = iConfig.getUntrackedParameter<bool>("DoTreeCell",false);
150  doPassive_ = iConfig.getUntrackedParameter<bool>("DoPassive",false);
151 
152 #ifdef EDM_ML_DEBUG
153  std::cout << "HGCalTBAnalyzer:: SimHits = " << doSimHits_ << " Digis = "
154  << doDigis_ << ":" << sampleIndex_ << " RecHits = " << doRecHits_
155  << " useDets " << ifEE_ << ":" << ifFH_ << ":" << ifBH_ << ":"
156  << ifBeam_ << " zFront " << zFrontEE_ << ":" << zFrontFH_ << ":"
157  << zFrontBH_ << " IdBeam " << idBeams_.size() << ":";
158  for (auto id : idBeams_) std::cout << " " << id;
159  std::cout << std::endl;
160 #endif
161  if (idBeams_.size() == 0) idBeams_.push_back(1001);
162 
163  edm::InputTag tmp0 = iConfig.getParameter<edm::InputTag>("GeneratorSrc");
164  tok_hepMC_ = consumes<edm::HepMCProduct>(tmp0);
165 
166 #ifdef EDM_ML_DEBUG
167  std::cout << "HGCalTBAnalyzer:: GeneratorSource = " << tmp0 << std::endl;
168 #endif
169  std::string tmp1 = iConfig.getParameter<std::string>("CaloHitSrcEE");
170  tok_hitsEE_ = consumes<edm::PCaloHitContainer>(edm::InputTag("g4SimHits",tmp1));
171  tok_simTk_ = consumes<edm::SimTrackContainer>(edm::InputTag("g4SimHits"));
172  tok_simVtx_ = consumes<edm::SimVertexContainer>(edm::InputTag("g4SimHits"));
173  edm::InputTag tmp2 = iConfig.getParameter<edm::InputTag>("DigiSrcEE");
174  tok_digiEE_ = consumes<HGCEEDigiCollection>(tmp2);
175  edm::InputTag tmp3 = iConfig.getParameter<edm::InputTag>("RecHitSrcEE");
176  tok_hitrEE_ = consumes<HGCRecHitCollection>(tmp3);
177 #ifdef EDM_ML_DEBUG
178  if (ifEE_) {
179  std::cout << "HGCalTBAnalyzer:: Detector " << detectorEE_ << " with tags "
180  << tmp1 << ", " << tmp2 << ", " << tmp3 << std::endl;
181  }
182 #endif
183  tmp1 = iConfig.getParameter<std::string>("CaloHitSrcFH");
184  tok_hitsFH_ = consumes<edm::PCaloHitContainer>(edm::InputTag("g4SimHits",tmp1));
185  tmp2 = iConfig.getParameter<edm::InputTag>("DigiSrcFH");
186  tok_digiFH_ = consumes<HGCHEDigiCollection>(tmp2);
187  tmp3 = iConfig.getParameter<edm::InputTag>("RecHitSrcFH");
188  tok_hitrFH_ = consumes<HGCRecHitCollection>(tmp3);
189 #ifdef EDM_ML_DEBUG
190  if (ifFH_) {
191  std::cout << "HGCalTBAnalyzer:: Detector " << detectorFH_ << " with tags "
192  << tmp1 << ", " << tmp2 << ", " << tmp3 << std::endl;
193  }
194 #endif
195  tmp1 = iConfig.getParameter<std::string>("CaloHitSrcBH");
196  tok_hitsBH_ = consumes<edm::PCaloHitContainer>(edm::InputTag("g4SimHits",tmp1));
197  tmp2 = iConfig.getParameter<edm::InputTag>("DigiSrcBH");
198  tok_digiBH_ = consumes<HGCBHDigiCollection>(tmp2);
199  tmp3 = iConfig.getParameter<edm::InputTag>("RecHitSrcBH");
200  tok_hitrBH_ = consumes<HGCRecHitCollection>(tmp3);
201 
203  edm::InputTag tmp = iConfig.getParameter<edm::InputTag>("HGCPassiveEE");
204  tok_hgcPHEE_ = consumes<edm::PassiveHitContainer>(tmp);
205 
206  tmp = iConfig.getParameter<edm::InputTag>("HGCPassiveFH");
207  tok_hgcPHFH_ = consumes<edm::PassiveHitContainer>(tmp);
208 
209  tmp = iConfig.getParameter<edm::InputTag>("HGCPassiveBH");
210  tok_hgcPHBH_ = consumes<edm::PassiveHitContainer>(tmp);
211 
212  tmp = iConfig.getParameter<edm::InputTag>("HGCPassiveCMSE");
213  tok_hgcPHCMSE_ = consumes<edm::PassiveHitContainer>(tmp);
214 
215 #ifdef EDM_ML_DEBUG
216  if (ifBH_) {
217  std::cout << "HGCalTBAnalyzer:: Detector " << detectorBH_ << " with tags "
218  << tmp1 << ", " << tmp2 << ", " << tmp3 << std::endl;
219  }
220 #endif
221  tmp1 = iConfig.getParameter<std::string>("CaloHitSrcBeam");
222  tok_hitsBeam_= consumes<edm::PCaloHitContainer>(edm::InputTag("g4SimHits",tmp1));
223 #ifdef EDM_ML_DEBUG
224  if (ifBeam_) {
225  std::cout << "HGCalTBAnalyzer:: Detector " << detectorBeam_
226  << " with tags " << tmp1 << std::endl;
227  }
228 #endif
229 }
std::string detectorEE_
std::string detectorBH_
edm::EDGetToken tok_hitrBH_
std::string detectorFH_
edm::EDGetToken tok_digiFH_
edm::EDGetTokenT< edm::PCaloHitContainer > tok_hitsFH_
edm::EDGetTokenT< edm::PCaloHitContainer > tok_hitsBH_
std::vector< int > idBeams_
edm::EDGetTokenT< edm::SimTrackContainer > tok_simTk_
edm::EDGetToken tok_hitrFH_
edm::EDGetTokenT< edm::PCaloHitContainer > tok_hitsBeam_
edm::EDGetTokenT< edm::HepMCProduct > tok_hepMC_
edm::EDGetTokenT< edm::PassiveHitContainer > tok_hgcPHEE_
edm::EDGetTokenT< edm::PassiveHitContainer > tok_hgcPHBH_
std::string detectorBeam_
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
edm::EDGetTokenT< edm::PCaloHitContainer > tok_hitsEE_
edm::EDGetToken tok_digiBH_
edm::EDGetTokenT< edm::PassiveHitContainer > tok_hgcPHFH_
edm::EDGetToken tok_hitrEE_
edm::EDGetTokenT< edm::SimVertexContainer > tok_simVtx_
edm::EDGetToken tok_digiEE_
edm::EDGetTokenT< edm::PassiveHitContainer > tok_hgcPHCMSE_
HGCalTBAnalyzer::~HGCalTBAnalyzer ( )

Definition at line 231 of file HGCalTBAnalyzer.cc.

231 {}

Member Function Documentation

void HGCalTBAnalyzer::analyze ( edm::Event const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

EE

FH

BH

CMSE

Implements edm::one::EDAnalyzerBase.

Definition at line 486 of file HGCalTBAnalyzer.cc.

References ecalMGPA::adc(), analyzeDigi(), analyzePassiveHits(), analyzeRecHits(), analyzeSimHits(), analyzeSimTracks(), edm::HandleBase::clear(), gather_cfg::cout, HGCSample::data(), detectorBeam_, detectorBH_, detectorEE_, detectorFH_, doDigis_, doPassive_, doRecHits_, doSimHits_, doTree_, edm::Event::getByToken(), edm::HepMCProduct::GetEvent(), hBeam_, hgcons_, hgcPassiveBHEnergy_, hgcPassiveBHID_, hgcPassiveBHName_, hgcPassiveCMSEEnergy_, hgcPassiveCMSEID_, hgcPassiveCMSEName_, hgcPassiveEEEnergy_, hgcPassiveEEID_, hgcPassiveEEName_, hgcPassiveFHEnergy_, hgcPassiveFHID_, hgcPassiveFHName_, idBeams_, ifBeam_, ifBH_, ifEE_, ifFH_, edm::HandleBase::isValid(), gen::k, HGCalDDDConstants::layers(), AHCalDetId::MaxDepth, AlCaHLTBitMon_ParallelJobs::p, sampleIndex_, simHitCellEnBeam_, simHitCellEnBH_, simHitCellEnEE_, simHitCellEnFH_, simHitCellIdBeam_, simHitCellIdBH_, simHitCellIdEE_, simHitCellIdFH_, simHitLayEn1BH_, simHitLayEn1EE_, simHitLayEn1FH_, simHitLayEn2BH_, simHitLayEn2EE_, simHitLayEn2FH_, simHitLayEnBeam_, edm::SortedCollection< T, SORT >::size(), tok_digiEE_, tok_digiFH_, tok_hepMC_, tok_hgcPHBH_, tok_hgcPHCMSE_, tok_hgcPHEE_, tok_hgcPHFH_, tok_hitrEE_, tok_hitrFH_, tok_hitsBeam_, tok_hitsBH_, tok_hitsEE_, tok_hitsFH_, tok_simTk_, tok_simVtx_, tree_, zFrontBH_, zFrontEE_, and zFrontFH_.

Referenced by endRun().

487  {
488 
489  //Generator input
491  iEvent.getByToken(tok_hepMC_,evtMC);
492  if (!evtMC.isValid()) {
493  edm::LogWarning("HGCal") << "no HepMCProduct found";
494  } else {
495  const HepMC::GenEvent * myGenEvent = evtMC->GetEvent();
496  unsigned int k(0);
497  for (HepMC::GenEvent::particle_const_iterator p = myGenEvent->particles_begin();
498  p != myGenEvent->particles_end(); ++p, ++k) {
499  if (k == 0) hBeam_->Fill((*p)->momentum().rho());
500 #ifdef EDM_ML_DEBUG
501  std::cout << "Particle[" << k << "] with p " << (*p)->momentum().rho()
502  << " theta " << (*p)->momentum().theta() << " phi "
503  << (*p)->momentum().phi() << std::endl;
504 #endif
505  }
506  }
507 
508  //Now the Simhits
509  if (doSimHits_) {
511  iEvent.getByToken(tok_simTk_, SimTk);
513  iEvent.getByToken(tok_simVtx_, SimVtx);
514  analyzeSimTracks(SimTk, SimVtx);
515 
516  simHitLayEn1EE_.clear(); simHitLayEn2EE_.clear();
517  simHitLayEn1FH_.clear(); simHitLayEn2FH_.clear();
518  simHitLayEn1BH_.clear(); simHitLayEn2BH_.clear();
519  simHitLayEnBeam_.clear();
520  simHitCellIdEE_.clear(); simHitCellEnEE_.clear();
521  simHitCellIdFH_.clear(); simHitCellEnFH_.clear();
522  simHitCellIdBH_.clear(); simHitCellEnBH_.clear();
523  simHitCellIdBeam_.clear(); simHitCellEnBeam_.clear();
524  edm::Handle<edm::PCaloHitContainer> theCaloHitContainers;
525  std::vector<PCaloHit> caloHits;
526  if (ifEE_) {
527  simHitLayEn1EE_ = std::vector<float>(hgcons_[0]->layers(false),0);
528  simHitLayEn2EE_ = std::vector<float>(hgcons_[0]->layers(true),0);
529  iEvent.getByToken(tok_hitsEE_, theCaloHitContainers);
530  if (theCaloHitContainers.isValid()) {
531 #ifdef EDM_ML_DEBUG
532  std::cout << "PcalohitContainer for " << detectorEE_ << " has "
533  << theCaloHitContainers->size() << " hits" << std::endl;
534 #endif
535  caloHits.clear();
536  caloHits.insert(caloHits.end(), theCaloHitContainers->begin(),
537  theCaloHitContainers->end());
538  analyzeSimHits(0, caloHits, zFrontEE_);
539  } else {
540 #ifdef EDM_ML_DEBUG
541  std::cout << "PCaloHitContainer does not exist for " << detectorEE_
542  << " !!!" << std::endl;
543 #endif
544  }
545  }
546  if (ifFH_) {
547  simHitLayEn1FH_ = std::vector<float>(hgcons_[1]->layers(false),0);
548  simHitLayEn2FH_ = std::vector<float>(hgcons_[1]->layers(true),0);
549  iEvent.getByToken(tok_hitsFH_, theCaloHitContainers);
550  if (theCaloHitContainers.isValid()) {
551 #ifdef EDM_ML_DEBUG
552  std::cout << "PcalohitContainer for " << detectorFH_ << " has "
553  << theCaloHitContainers->size() << " hits" << std::endl;
554 #endif
555  caloHits.clear();
556  caloHits.insert(caloHits.end(), theCaloHitContainers->begin(),
557  theCaloHitContainers->end());
558  analyzeSimHits(1, caloHits, zFrontFH_);
559  } else {
560 #ifdef EDM_ML_DEBUG
561  std::cout << "PCaloHitContainer does not exist for " << detectorFH_
562  << " !!!" << std::endl;
563 #endif
564  }
565  }
566  if (ifBH_) {
567  simHitLayEn1BH_ = std::vector<float>(AHCalDetId::MaxDepth,0);
568  simHitLayEn2BH_ = std::vector<float>(AHCalDetId::MaxDepth,0);
569  iEvent.getByToken(tok_hitsBH_, theCaloHitContainers);
570  if (theCaloHitContainers.isValid()) {
571 #ifdef EDM_ML_DEBUG
572  std::cout << "PcalohitContainer for " << detectorBH_ << " has "
573  << theCaloHitContainers->size() << " hits" << std::endl;
574 #endif
575  caloHits.clear();
576  caloHits.insert(caloHits.end(), theCaloHitContainers->begin(),
577  theCaloHitContainers->end());
578  analyzeSimHits(2, caloHits, zFrontBH_);
579  } else {
580 #ifdef EDM_ML_DEBUG
581  std::cout << "PCaloHitContainer does not exist for " << detectorBH_
582  << " !!!" << std::endl;
583 #endif
584  }
585  }
586  if (ifBeam_) {
587  simHitLayEnBeam_ = std::vector<float>(idBeams_.size(),0);
588  iEvent.getByToken(tok_hitsBeam_, theCaloHitContainers);
589  if (theCaloHitContainers.isValid()) {
590 #ifdef EDM_ML_DEBUG
591  std::cout << "PcalohitContainer for " << detectorBeam_ << " has "
592  << theCaloHitContainers->size() << " hits" << std::endl;
593 #endif
594  caloHits.clear();
595  caloHits.insert(caloHits.end(), theCaloHitContainers->begin(),
596  theCaloHitContainers->end());
597  analyzeSimHits(3, caloHits, 0.0);
598  } else {
599 #ifdef EDM_ML_DEBUG
600  std::cout << "PCaloHitContainer does not exist for " << detectorBeam_
601  << " !!!" << std::endl;
602 #endif
603  }
604  }
605  //if (doTree_) tree_->Fill();
606  }//if (doSimHits_)
607 
609  if (doPassive_) {
610  hgcPassiveEEEnergy_.clear(); hgcPassiveFHEnergy_.clear();
612  hgcPassiveEEName_.clear(); hgcPassiveFHName_.clear();
613  hgcPassiveBHName_.clear(); hgcPassiveCMSEName_.clear();
614  hgcPassiveEEID_.clear(); hgcPassiveFHID_.clear();
615  hgcPassiveBHID_.clear(); hgcPassiveCMSEID_.clear();
616 
619  iEvent.getByToken(tok_hgcPHEE_,hgcPHEE);
620  analyzePassiveHits(hgcPHEE, 1);
621 
624  iEvent.getByToken(tok_hgcPHFH_,hgcPHFH);
625  analyzePassiveHits(hgcPHFH, 2);
626 
629  iEvent.getByToken(tok_hgcPHBH_,hgcPHBH);
630  analyzePassiveHits(hgcPHBH, 3);
631 
634  iEvent.getByToken(tok_hgcPHCMSE_,hgcPHCMSE);
635  analyzePassiveHits(hgcPHCMSE, 4);
636  }
637 
638  if ((doSimHits_ || doPassive_) && (doTree_)) tree_->Fill();
639 
640  //Now the Digis
641  if (doDigis_) {
642  if (ifEE_) {
643  edm::Handle<HGCEEDigiCollection> theDigiContainers;
644  iEvent.getByToken(tok_digiEE_, theDigiContainers);
645  if (theDigiContainers.isValid()) {
646 #ifdef EDM_ML_DEBUG
647  std::cout << "HGCDigiCintainer for " << detectorEE_ << " with "
648  << theDigiContainers->size() << " element(s)" << std::endl;
649 #endif
650  for (auto it : *theDigiContainers) {
651  HGCEEDetId detId = (it.id());
652  HGCSample hgcSample = it.sample(sampleIndex_);
653  uint16_t adc = hgcSample.data();
654  analyzeDigi(0, detId, adc);
655  }
656  }
657  }
658  if (ifFH_) {
659  edm::Handle<HGCHEDigiCollection> theDigiContainers;
660  iEvent.getByToken(tok_digiFH_, theDigiContainers);
661  if (theDigiContainers.isValid()) {
662 #ifdef EDM_ML_DEBUG
663  std::cout << "HGCDigiContainer for " << detectorFH_ << " with "
664  << theDigiContainers->size() << " element(s)" << std::endl;
665 #endif
666  for (auto it : *theDigiContainers) {
667  HGCHEDetId detId = (it.id());
668  HGCSample hgcSample = it.sample(sampleIndex_);
669  uint16_t adc = hgcSample.data();
670  analyzeDigi(1, detId, adc);
671  }
672  }
673  }
674  }
675 
676  //The Rechits
677  if (doRecHits_) {
678  edm::Handle<HGCRecHitCollection> theCaloHitContainers;
679  if (ifEE_) {
680  iEvent.getByToken(tok_hitrEE_, theCaloHitContainers);
681  if (theCaloHitContainers.isValid()) {
682 #ifdef EDM_ML_DEBUG
683  std::cout << "HGCRecHitCollection for " << detectorEE_ << " has "
684  << theCaloHitContainers->size() << " hits" << std::endl;
685 #endif
686  analyzeRecHits(0, theCaloHitContainers);
687  } else {
688 #ifdef EDM_ML_DEBUG
689  std::cout << "HGCRecHitCollection does not exist for " << detectorEE_
690  << " !!!" << std::endl;
691 #endif
692  }
693  }
694  if (ifFH_) {
695  iEvent.getByToken(tok_hitrFH_, theCaloHitContainers);
696  if (theCaloHitContainers.isValid()) {
697 #ifdef EDM_ML_DEBUG
698  std::cout << "HGCRecHitCollection for " << detectorFH_ << " has "
699  << theCaloHitContainers->size() << " hits" << std::endl;
700 #endif
701  analyzeRecHits(1, theCaloHitContainers);
702  } else {
703 #ifdef EDM_ML_DEBUG
704  std::cout << "HGCRecHitCollection does not exist for " << detectorFH_
705  << " !!!" << std::endl;
706 #endif
707  }//else
708  }//if (ifFH_)
709  }//if (doRecHits_)
710 
711 }//void HGCalTBAnalyzer::analyze
int adc(sample_type sample)
get the ADC sample (12 bits)
std::string detectorEE_
std::vector< float > simHitLayEn2EE_
uint32_t data() const
Definition: HGCSample.h:60
std::vector< float > simHitLayEn2BH_
std::vector< uint32_t > simHitCellIdFH_
std::string detectorBH_
void analyzeSimTracks(edm::Handle< edm::SimTrackContainer > const &SimTk, edm::Handle< edm::SimVertexContainer > const &SimVtx)
std::vector< std::string > hgcPassiveFHName_
std::vector< float > simHitLayEn1EE_
std::vector< float > hgcPassiveBHEnergy_
static const int MaxDepth
get the layer number
Definition: AHCalDetId.h:41
std::string detectorFH_
edm::EDGetToken tok_digiFH_
edm::EDGetTokenT< edm::PCaloHitContainer > tok_hitsFH_
std::vector< std::string > hgcPassiveBHName_
std::vector< float > hgcPassiveCMSEEnergy_
std::vector< int > hgcPassiveEEID_
std::vector< float > hgcPassiveEEEnergy_
wrapper for a data word
Definition: HGCSample.h:13
std::vector< float > simHitCellEnFH_
edm::EDGetTokenT< edm::PCaloHitContainer > tok_hitsBH_
void analyzeSimHits(int type, std::vector< PCaloHit > &hits, double zFront)
int iEvent
Definition: GenABIO.cc:230
unsigned int layers(bool reco) const
std::vector< int > idBeams_
void analyzeRecHits(int type, edm::Handle< HGCRecHitCollection > &hits)
std::vector< std::string > hgcPassiveCMSEName_
edm::EDGetTokenT< edm::SimTrackContainer > tok_simTk_
const HGCalDDDConstants * hgcons_[2]
edm::EDGetToken tok_hitrFH_
edm::EDGetTokenT< edm::PCaloHitContainer > tok_hitsBeam_
edm::EDGetTokenT< edm::HepMCProduct > tok_hepMC_
bool isValid() const
Definition: HandleBase.h:74
std::vector< uint32_t > simHitCellIdBH_
void analyzePassiveHits(edm::Handle< edm::PassiveHitContainer > const &hgcPh, int subdet)
int k[5][pyjets_maxn]
std::vector< float > hgcPassiveFHEnergy_
edm::EDGetTokenT< edm::PassiveHitContainer > tok_hgcPHEE_
std::vector< int > hgcPassiveCMSEID_
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:38
edm::EDGetTokenT< edm::PassiveHitContainer > tok_hgcPHBH_
std::vector< float > simHitCellEnBeam_
std::vector< std::string > hgcPassiveEEName_
std::string detectorBeam_
void analyzeDigi(int type, const T1 &detId, uint16_t adc)
size_type size() const
std::vector< int > hgcPassiveBHID_
edm::EDGetTokenT< edm::PCaloHitContainer > tok_hitsEE_
std::vector< float > simHitLayEn1FH_
std::vector< int > hgcPassiveFHID_
std::vector< float > simHitCellEnBH_
edm::EDGetTokenT< edm::PassiveHitContainer > tok_hgcPHFH_
std::vector< float > simHitLayEn1BH_
std::vector< uint32_t > simHitCellIdEE_
std::vector< float > simHitCellEnEE_
std::vector< uint32_t > simHitCellIdBeam_
edm::EDGetToken tok_hitrEE_
std::vector< float > simHitLayEn2FH_
edm::EDGetTokenT< edm::SimVertexContainer > tok_simVtx_
edm::EDGetToken tok_digiEE_
edm::EDGetTokenT< edm::PassiveHitContainer > tok_hgcPHCMSE_
std::vector< float > simHitLayEnBeam_
template<class T1 >
void HGCalTBAnalyzer::analyzeDigi ( int  type,
const T1 &  detId,
uint16_t  adc 
)
private

Definition at line 925 of file HGCalTBAnalyzer.cc.

References HGCalGeometry::getPosition(), hDigiADC_, hDigiLng_, hDigiOcc_, and hgeom_.

Referenced by analyze(), and endRun().

925  {
926 
927  DetId id1 = DetId(detId.rawId());
928  GlobalPoint global = hgeom_[type]->getPosition(id1);
929  hDigiOcc_[type]->Fill(global.x(),global.y());
930  hDigiLng_[type]->Fill(global.z());
931  hDigiADC_[type]->Fill(adc);
932 }
int adc(sample_type sample)
get the ADC sample (12 bits)
type
Definition: HCALResponse.h:21
GlobalPoint getPosition(const DetId &id) const
const HGCalGeometry * hgeom_[2]
Definition: DetId.h:18
void HGCalTBAnalyzer::analyzePassiveHits ( edm::Handle< edm::PassiveHitContainer > const &  hgcPh,
int  subdet 
)
private

Definition at line 984 of file HGCalTBAnalyzer.cc.

References gather_cfg::cout, DEFINE_FWK_MODULE, hgcPassiveBHEnergy_, hgcPassiveBHID_, hgcPassiveBHName_, hgcPassiveCMSEEnergy_, hgcPassiveCMSEID_, hgcPassiveCMSEName_, hgcPassiveEEEnergy_, hgcPassiveEEID_, hgcPassiveEEName_, hgcPassiveFHEnergy_, hgcPassiveFHID_, hgcPassiveFHName_, dataset::name, AlCaHLTBitMon_QueryRunRegistry::string, ntuplemaker::time, and findQualityFiles::v.

Referenced by analyze(), and endRun().

984  {
985 
986  for (auto v : *hgcPH) {
987  double energy = v.energy();
988  std::string name = v.vname();
989  unsigned int id = v.id();
990 #ifdef EDM_ML_DEBUG
991  double time = v.time();
992  std::cout << "HGCalTBAnalyzer::analyzePassiveHits:Energy:Time:Name:Id : "
993  << energy << ":" << time << ":" << name << ":" << id
994  << std::endl;
995 #endif
996 
997  if (subdet==1) {
998  hgcPassiveEEEnergy_.push_back(energy);
999  hgcPassiveEEName_.push_back(name);
1000  hgcPassiveEEID_.push_back(id);
1001  } else if (subdet==2) {
1002  hgcPassiveFHEnergy_.push_back(energy);
1003  hgcPassiveFHName_.push_back(name);
1004  hgcPassiveFHID_.push_back(id);
1005  } else if (subdet==3) {
1006  hgcPassiveBHEnergy_.push_back(energy);
1007  hgcPassiveBHName_.push_back(name);
1008  hgcPassiveBHID_.push_back(id);
1009  } else if (subdet==4) {
1010  hgcPassiveCMSEEnergy_.push_back(energy);
1011  hgcPassiveCMSEName_.push_back(name);
1012  hgcPassiveCMSEID_.push_back(id);
1013  }
1014  }
1015 }
std::vector< std::string > hgcPassiveFHName_
std::vector< float > hgcPassiveBHEnergy_
std::vector< std::string > hgcPassiveBHName_
std::vector< float > hgcPassiveCMSEEnergy_
std::vector< int > hgcPassiveEEID_
std::vector< float > hgcPassiveEEEnergy_
std::vector< std::string > hgcPassiveCMSEName_
std::vector< float > hgcPassiveFHEnergy_
std::vector< int > hgcPassiveCMSEID_
std::vector< std::string > hgcPassiveEEName_
std::vector< int > hgcPassiveBHID_
std::vector< int > hgcPassiveFHID_
void HGCalTBAnalyzer::analyzeRecHits ( int  type,
edm::Handle< HGCRecHitCollection > &  hits 
)
private

Definition at line 934 of file HGCalTBAnalyzer.cc.

References HGCalDetId::cell(), gather_cfg::cout, plotBeamSpotDB::first, HGCalGeometry::getPosition(), hgcons_, hgeom_, hRecHitE_, hRecHitLat_, hRecHitLng1_, hRecHitLng_, hRecHitOcc_, HGCalDetId::layer(), edm::second(), HGCalDDDConstants::waferZ(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by analyze(), and endRun().

935  {
936 
937  std::map<int,double> map_hitLayer;
938  std::map<int,std::pair<DetId,double> > map_hitCell;
939  for (auto it : *hits) {
940  DetId detId = it.id();
941  GlobalPoint global = hgeom_[type]->getPosition(detId);
942  double energy = it.energy();
943  int layer = HGCalDetId(detId).layer();
944  int cell = HGCalDetId(detId).cell();
945  hRecHitOcc_[type]->Fill(global.x(),global.y(),energy);
946  hRecHitE_[type]->Fill(energy);
947  if (map_hitLayer.count(layer) != 0) {
948  map_hitLayer[layer] += energy;
949  } else {
950  map_hitLayer[layer] = energy;
951  }
952  if (map_hitCell.count(cell) != 0) {
953  double ee = energy + map_hitCell[cell].second;
954  map_hitCell[cell] = std::pair<uint32_t,double>(detId,ee);
955  } else {
956  map_hitCell[cell] = std::pair<uint32_t,double>(detId,energy);
957  }
958 #ifdef EDM_ML_DEBUG
959  std::cout << "RecHit: " << layer << " " << global.x() << " " << global.y()
960  << " " << global.z() << " " << energy << std::endl;
961 #endif
962  }
963 
964  for (auto itr : map_hitLayer) {
965  int layer = itr.first;
966  double energy = itr.second;
967  double zp = hgcons_[type]->waferZ(layer,true);
968 #ifdef EDM_ML_DEBUG
969  std::cout << "SimHit:Layer " << layer << " " << zp << " " << energy
970  << std::endl;
971 #endif
972  hRecHitLng_[type]->Fill(zp,energy);
973  hRecHitLng1_[type]->Fill(layer,energy);
974  }
975 
976  for (auto itr : map_hitCell) {
977  DetId detId = ((itr.second).first);
978  double energy = ((itr.second).second);
979  GlobalPoint global = hgeom_[type]->getPosition(detId);
980  hRecHitLat_[type]->Fill(global.x(),global.y(),energy);
981  }
982 }
type
Definition: HCALResponse.h:21
TProfile * hRecHitLng_[3]
T y() const
Definition: PV3DBase.h:63
GlobalPoint getPosition(const DetId &id) const
U second(std::pair< T, U > const &p)
const HGCalGeometry * hgeom_[2]
T z() const
Definition: PV3DBase.h:64
const HGCalDDDConstants * hgcons_[2]
double waferZ(int layer, bool reco) const
Definition: DetId.h:18
TProfile2D * hRecHitLat_[3]
int cell() const
get the absolute value of the cell #&#39;s in x and y
Definition: HGCalDetId.h:39
T x() const
Definition: PV3DBase.h:62
int layer() const
get the layer #
Definition: HGCalDetId.h:48
TProfile * hRecHitLng1_[3]
void HGCalTBAnalyzer::analyzeSimHits ( int  type,
std::vector< PCaloHit > &  hits,
double  zFront 
)
private

Definition at line 713 of file HGCalTBAnalyzer.cc.

References gather_cfg::cout, particleFlowClusterECALTimeSelected_cfi::depth, AHCalDetId::depth(), plotBeamSpotDB::first, AHCalDetId::getXY(), AHCalDetId::getZ(), HcalOther, hgcons_, hSimHitE_, hSimHitEn_, hSimHitLat_, hSimHitLayEn1BH_, hSimHitLayEn1EE_, hSimHitLayEn1FH_, hSimHitLayEn2BH_, hSimHitLayEn2EE_, hSimHitLayEn2FH_, hSimHitLayEnBeam_, hSimHitLng1_, hSimHitLng2_, hSimHitLng_, hSimHitT_, mps_fire::i, AHCalDetId::icol(), AHCalDetId::icolAbs(), hcalTTPDigis_cfi::id, idBeams_, training_settings::idx, AHCalDetId::irow(), AHCalDetId::irowAbs(), gen::k, HGCalDDDConstants::locateCell(), HGCalTestNumbering::packHexagonIndex(), edm::second(), simHitCellEnBeam_, simHitCellEnBH_, simHitCellEnEE_, simHitCellEnFH_, simHitCellIdBeam_, simHitCellIdBH_, simHitCellIdEE_, simHitCellIdFH_, simHitLayEn1BH_, simHitLayEn1EE_, simHitLayEn1FH_, simHitLayEn2BH_, simHitLayEn2EE_, simHitLayEn2FH_, simHitLayEnBeam_, HGCalDDDConstants::simToReco(), HcalDetId::subdet(), ntuplemaker::time, HGCalTestNumbering::unpackHexagonIndex(), HcalTestBeamNumbering::unpackIndex(), HGCalDDDConstants::waferZ(), geometryCSVtoXML::xx, geometryCSVtoXML::xy, HcalDigiParam_cfi::zside, and AHCalDetId::zside().

Referenced by analyze(), and endRun().

714  {
715 
716  std::map<uint32_t,double> map_hits, map_hitn;
717  std::map<int,double> map_hitDepth;
718  std::map<int,std::pair<uint32_t,double> > map_hitLayer, map_hitCell;
719  double entot(0);
720  for (unsigned int i=0; i<hits.size(); i++) {
721  double energy = hits[i].energy();
722  double time = hits[i].time();
723  uint32_t id = hits[i].id();
724  entot += energy;
725  int subdet, zside, layer, sector, subsector(0), cell, depth(0), idx(0);
726  if (type == 2) {
727  subdet = HcalDetId(id).subdet();
728  if (subdet != HcalOther) continue;
729  AHCalDetId hid(id);
730  layer = depth = hid.depth();
731  zside = hid.zside();
732  sector = hid.irow();
733  cell = hid.icol();
734  idx = ((hid.irowAbs()*100) + (hid.icolAbs()));
735  } else if (type == 3) {
736  HcalTestBeamNumbering::unpackIndex(id, subdet, layer, sector, cell);
737  depth = layer; zside = 1;
738  idx = subdet*1000 + layer;
739  layer = idx;
740  } else {
741  HGCalTestNumbering::unpackHexagonIndex(id, subdet, zside, layer, sector,
742  subsector, cell);
743  depth = hgcons_[type]->simToReco(cell,layer,sector,true).second;
744  idx = sector*1000+cell;
745  }
746 #ifdef EDM_ML_DEBUG
747  std::cout << "SimHit:Hit[" << i << "] Id " << subdet << ":" << zside << ":"
748  << layer << ":" << sector << ":" << subsector << ":" << cell
749  << ":" << depth << " Energy " << energy << " Time " << time
750  << std::endl;
751 #endif
752  if (map_hits.count(id) != 0) {
753  map_hits[id] += energy;
754  } else {
755  map_hits[id] = energy;
756  }
757  if (map_hitLayer.count(layer) != 0) {
758  double ee = energy + map_hitLayer[layer].second;
759  map_hitLayer[layer] = std::pair<uint32_t,double>(id,ee);
760  } else {
761  map_hitLayer[layer] = std::pair<uint32_t,double>(id,energy);
762  }
763  if (depth >= 0) {
764  if (map_hitCell.count(idx) != 0) {
765  double ee = energy + map_hitCell[idx].second;
766  map_hitCell[idx] = std::pair<uint32_t,double>(id,ee);
767  } else {
768  map_hitCell[idx] = std::pair<uint32_t,double>(id,energy);
769  }
770  if (map_hitDepth.count(depth) != 0) {
771  map_hitDepth[depth] += energy;
772  } else {
773  map_hitDepth[depth] = energy;
774  }
775  uint32_t idn = (type >= 2) ? id :
776  HGCalTestNumbering::packHexagonIndex(subdet, zside, depth, sector,
777  subsector, cell);
778  if (map_hitn.count(idn) != 0) {
779  map_hitn[idn] += energy;
780  } else {
781  map_hitn[idn] = energy;
782  }
783  }
784  hSimHitT_[type]->Fill(time,energy);
785  }
786 
787  hSimHitEn_[type]->Fill(entot);
788  for (auto itr : map_hits) {
789  hSimHitE_[type]->Fill(itr.second);
790  }
791 
792  for (auto itr : map_hitLayer) {
793  int layer = itr.first - 1;
794  double energy = (itr.second).second;
795  double zp(0);
796  if (type < 2) zp = hgcons_[type]->waferZ(layer+1,false);
797  else if (type == 2) zp = AHCalDetId((itr.second).first).getZ();
798 #ifdef EDM_ML_DEBUG
799  std::cout << "SimHit:Layer " << layer+1 << " Z " << zp << ":" << zp-zFront
800  << " E " << energy << std::endl;
801 #endif
802  if (type < 3) {
803  hSimHitLng_[type]->Fill(zp-zFront,energy);
804  hSimHitLng2_[type]->Fill(layer+1,energy);
805  }
806  if (type == 0) {
807  if (layer < (int)(hSimHitLayEn1EE_.size())) {
808  simHitLayEn1EE_[layer] = energy;
809  hSimHitLayEn1EE_[layer]->Fill(energy);
810  }
811  } else if (type == 1) {
812  if (layer < (int)(hSimHitLayEn1FH_.size())) {
813  simHitLayEn1FH_[layer] = energy;
814  hSimHitLayEn1FH_[layer]->Fill(energy);
815  }
816  } else if (type == 2) {
817  if (layer < (int)(hSimHitLayEn1BH_.size())) {
818  simHitLayEn1BH_[layer] = energy;
819  hSimHitLayEn1BH_[layer]->Fill(energy);
820  }
821  } else {
822  for (unsigned int k=0; k<idBeams_.size(); ++k) {
823  if (layer+1 == idBeams_[k]) {
824  simHitLayEnBeam_[k] = energy;
825  hSimHitLayEnBeam_[k]->Fill(energy);
826  break;
827  }
828  }
829  }
830  }
831  for (auto itr : map_hitDepth) {
832  int layer = itr.first - 1;
833  double energy = itr.second;
834 #ifdef EDM_ML_DEBUG
835  std::cout << "SimHit:Layer " << layer+1 << " " << energy << std::endl;
836 #endif
837  hSimHitLng1_[type]->Fill(layer+1,energy);
838  if (type == 0) {
839  if (layer < (int)(hSimHitLayEn2EE_.size())) {
840  simHitLayEn2EE_[layer] = energy;
841  hSimHitLayEn2EE_[layer]->Fill(energy);
842  }
843  } else if (type == 1) {
844  if (layer < (int)(hSimHitLayEn2FH_.size())) {
845  simHitLayEn2FH_[layer] = energy;
846  hSimHitLayEn2FH_[layer]->Fill(energy);
847  }
848  } else if (type == 2) {
849  if (layer < (int)(hSimHitLayEn2BH_.size())) {
850  simHitLayEn2BH_[layer] = energy;
851  hSimHitLayEn2BH_[layer]->Fill(energy);
852  }
853  }
854  }
855 
856  if (type < 3) {
857  for (auto itr : map_hitCell) {
858  uint32_t id = ((itr.second).first);
859  double energy = ((itr.second).second);
860  std::pair<float,float> xy(0,0);
861  double xx(0);
862  if (type == 2) {
863  xy = AHCalDetId(id).getXY();
864  xx = xy.first;
865  } else {
866  int subdet, zside, layer, sector, subsector, cell;
867  HGCalTestNumbering::unpackHexagonIndex(id, subdet, zside, layer, sector,
868  subsector, cell);
869  xy = hgcons_[type]->locateCell(cell,layer,sector,false);
870  double zp = hgcons_[type]->waferZ(layer,false);
871  xx = (zp < 0) ? -xy.first : xy.first;
872  }
873  hSimHitLat_[type]->Fill(xx,xy.second,energy);
874  }
875  }
876 
877  for (auto itr : map_hitn) {
878  uint32_t id = itr.first;
879  double energy = itr.second;
880  if (type == 0) {
881  simHitCellIdEE_.push_back(id); simHitCellEnEE_.push_back(energy);
882  } else if (type == 1) {
883  simHitCellIdFH_.push_back(id); simHitCellEnFH_.push_back(energy);
884  } else if (type == 2) {
885  simHitCellIdBH_.push_back(id); simHitCellEnBH_.push_back(energy);
886  } else if (type == 3) {
887  simHitCellIdBeam_.push_back(id); simHitCellEnBeam_.push_back(energy);
888  }
889  }
890 }
std::vector< TH1D * > hSimHitLayEn2EE_
std::vector< float > simHitLayEn2EE_
type
Definition: HCALResponse.h:21
std::vector< float > simHitLayEn2BH_
std::vector< uint32_t > simHitCellIdFH_
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:49
TProfile * hSimHitLng1_[3]
TProfile * hSimHitLng2_[3]
std::vector< float > simHitLayEn1EE_
static uint32_t packHexagonIndex(int subdet, int z, int lay, int wafer, int celltyp, int cell)
double getZ() const
Definition: AHCalDetId.cc:57
std::pair< float, float > locateCell(int cell, int lay, int type, bool reco) const
std::vector< float > simHitCellEnFH_
TProfile2D * hSimHitLat_[3]
U second(std::pair< T, U > const &p)
std::vector< TH1D * > hSimHitLayEn1EE_
std::pair< int, int > simToReco(int cell, int layer, int mod, bool half) const
std::vector< TH1D * > hSimHitLayEn2BH_
std::vector< int > idBeams_
std::pair< double, double > getXY() const
get the local coordinate in the plane and along depth
Definition: AHCalDetId.cc:49
std::vector< TH1D * > hSimHitLayEnBeam_
const HGCalDDDConstants * hgcons_[2]
std::vector< TH1D * > hSimHitLayEn1FH_
std::vector< uint32_t > simHitCellIdBH_
double waferZ(int layer, bool reco) const
int k[5][pyjets_maxn]
std::vector< float > simHitCellEnBeam_
TProfile * hSimHitLng_[3]
std::vector< float > simHitLayEn1FH_
std::vector< float > simHitCellEnBH_
static void unpackIndex(const uint32_t &idx, int &det, int &lay, int &x, int &y)
std::vector< float > simHitLayEn1BH_
std::vector< uint32_t > simHitCellIdEE_
std::vector< TH1D * > hSimHitLayEn1BH_
std::vector< float > simHitCellEnEE_
std::vector< uint32_t > simHitCellIdBeam_
std::vector< float > simHitLayEn2FH_
static void unpackHexagonIndex(const uint32_t &idx, int &subdet, int &z, int &lay, int &wafer, int &celltyp, int &cell)
std::vector< TH1D * > hSimHitLayEn2FH_
std::vector< float > simHitLayEnBeam_
void HGCalTBAnalyzer::analyzeSimTracks ( edm::Handle< edm::SimTrackContainer > const &  SimTk,
edm::Handle< edm::SimVertexContainer > const &  SimVtx 
)
private

Definition at line 892 of file HGCalTBAnalyzer.cc.

References gather_cfg::cout, pBeam_, xBeam_, yBeam_, and zBeam_.

Referenced by analyze(), and endRun().

893  {
894 
895  xBeam_ = yBeam_ = zBeam_ = pBeam_ = -1000000;
896  int vertIndex(-1);
897  for (auto simTrkItr : *SimTk) {
898 #ifdef EDM_ML_DEBUG
899  std::cout << "Track " << simTrkItr.trackId() << " Vertex "
900  << simTrkItr.vertIndex() << " Type " << simTrkItr.type()
901  << " Charge " << simTrkItr.charge() << " momentum "
902  << simTrkItr.momentum() << " " << simTrkItr.momentum().P()
903  << std::endl;
904 #endif
905  if (vertIndex == -1) {
906  vertIndex = simTrkItr.vertIndex();
907  pBeam_ = simTrkItr.momentum().P();
908  }
909  }
910  if (vertIndex != -1 && vertIndex < (int)SimVtx->size()) {
911  edm::SimVertexContainer::const_iterator simVtxItr= SimVtx->begin();
912  for (int iv=0; iv<vertIndex; iv++) simVtxItr++;
913 #ifdef EDM_ML_DEBUG
914  std::cout << "Vertex " << vertIndex << " position "
915  << simVtxItr->position() << std::endl;
916 #endif
917  xBeam_ = simVtxItr->position().X();
918  yBeam_ = simVtxItr->position().Y();
919  zBeam_ = simVtxItr->position().Z();
920  }
921 
922 }
void HGCalTBAnalyzer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 276 of file HGCalTBAnalyzer.cc.

References detectorBeam_, detectorBH_, detectorEE_, detectorFH_, doDigis_, doPassive_, doRecHits_, doSimHits_, doTree_, doTreeCell_, fs_, hBeam_, hDigiADC_, hDigiLng_, hDigiOcc_, hgcPassiveBHEnergy_, hgcPassiveBHID_, hgcPassiveBHName_, hgcPassiveCMSEEnergy_, hgcPassiveCMSEID_, hgcPassiveCMSEName_, hgcPassiveEEEnergy_, hgcPassiveEEID_, hgcPassiveEEName_, hgcPassiveFHEnergy_, hgcPassiveFHID_, hgcPassiveFHName_, hRecHitE_, hRecHitLat_, hRecHitLng1_, hRecHitLng_, hRecHitOcc_, hSimHitE_, hSimHitEn_, hSimHitLat_, hSimHitLng1_, hSimHitLng2_, hSimHitLng_, hSimHitT_, mps_fire::i, ifBeam_, ifBH_, ifEE_, ifFH_, TFileService::make(), dataset::name, pBeam_, simHitCellEnBeam_, simHitCellEnBH_, simHitCellEnEE_, simHitCellEnFH_, simHitCellIdBeam_, simHitCellIdBH_, simHitCellIdEE_, simHitCellIdFH_, simHitLayEn1BH_, simHitLayEn1EE_, simHitLayEn1FH_, simHitLayEn2BH_, simHitLayEn2EE_, simHitLayEn2FH_, AlCaHLTBitMon_QueryRunRegistry::string, fftjetcommon_cfi::title, tree_, xBeam_, yBeam_, and zBeam_.

276  {
277 
278  char name[40], title[100];
279  hBeam_ = fs_->make<TH1D>("BeamP", "Beam Momentum", 1000, 0, 1000.0);
280  for (int i=0; i<3; ++i) {
281  bool book(ifEE_);
282  std::string det(detectorEE_);
283  if (i == 1) {
284  book = ifFH_;
285  det = detectorFH_;
286  } else if (i == 2) {
287  book = ifBH_;
288  det = detectorBH_;
289  }
290 
291  if (doSimHits_ && book) {
292  sprintf (name, "SimHitEn%s", det.c_str());
293  sprintf (title,"Sim Hit Energy for %s", det.c_str());
294  hSimHitE_[i] = fs_->make<TH1D>(name,title,100000,0.,0.2);
295  sprintf (name, "SimHitEnX%s", det.c_str());
296  sprintf (title,"Sim Hit Energy for %s", det.c_str());
297  hSimHitEn_[i] = fs_->make<TH1D>(name,title,100000,0.,0.2);
298  sprintf (name, "SimHitTm%s", det.c_str());
299  sprintf (title,"Sim Hit Timing for %s", det.c_str());
300  hSimHitT_[i] = fs_->make<TH1D>(name,title,5000,0.,500.0);
301  sprintf (name, "SimHitLat%s", det.c_str());
302  sprintf (title,"Lateral Shower profile (Sim Hit) for %s", det.c_str());
303  hSimHitLat_[i] = fs_->make<TProfile2D>(name,title,100,-100.,100.,100,-100.,100.);
304  sprintf (name, "SimHitLng%s", det.c_str());
305  sprintf (title,"Longitudinal Shower profile (Sim Hit) for %s",det.c_str());
306  hSimHitLng_[i] = fs_->make<TProfile>(name,title,50,0.,100.);
307  sprintf (name, "SimHitLng1%s", det.c_str());
308  sprintf (title,"Longitudinal Shower profile (Layer) for %s",det.c_str());
309  hSimHitLng1_[i] = fs_->make<TProfile>(name,title,200,0.,100.);
310  sprintf (name, "SimHitLng2%s", det.c_str());
311  sprintf (title,"Longitudinal Shower profile (Layer) for %s",det.c_str());
312  hSimHitLng2_[i] = fs_->make<TProfile>(name,title,200,0.,100.);
313  }
314 
315  if (doDigis_ && book) {
316  sprintf (name, "DigiADC%s", det.c_str());
317  sprintf (title,"ADC at Digi level for %s", det.c_str());
318  hDigiADC_[i] = fs_->make<TH1D>(name,title,100,0.,100.0);
319  sprintf (name, "DigiOcc%s", det.c_str());
320  sprintf (title,"Occupancy (Digi)for %s", det.c_str());
321  hDigiOcc_[i] = fs_->make<TH2D>(name,title,100,-10.,10.,100,-10.,10.);
322  sprintf (name, "DigiLng%s", det.c_str());
323  sprintf (title,"Longitudinal Shower profile (Digi) for %s",det.c_str());
324  hDigiLng_[i] = fs_->make<TH1D>(name,title,100,0.,10.);
325  }
326 
327  if (doRecHits_ && book) {
328  sprintf (name, "RecHitEn%s", det.c_str());
329  sprintf (title,"Rec Hit Energy for %s", det.c_str());
330  hRecHitE_[i] = fs_->make<TH1D>(name,title,1000,0.,10.0);
331  sprintf (name, "RecHitOcc%s", det.c_str());
332  sprintf (title,"Occupancy (Rec Hit)for %s", det.c_str());
333  hRecHitOcc_[i] = fs_->make<TH2D>(name,title,100,-10.,10.,100,-10.,10.);
334  sprintf (name, "RecHitLat%s", det.c_str());
335  sprintf (title,"Lateral Shower profile (Rec Hit) for %s", det.c_str());
336  hRecHitLat_[i] = fs_->make<TProfile2D>(name,title,100,-10.,10.,100,-10.,10.);
337  sprintf (name, "RecHitLng%s", det.c_str());
338  sprintf (title,"Longitudinal Shower profile (Rec Hit) for %s",det.c_str());
339  hRecHitLng_[i] = fs_->make<TProfile>(name,title,100,0.,10.);
340  sprintf (name, "RecHitLng1%s", det.c_str());
341  sprintf (title,"Longitudinal Shower profile vs Layer for %s",det.c_str());
342  hRecHitLng1_[i] = fs_->make<TProfile>(name,title,120,0.,60.);
343  }
344  }
345  if (ifBeam_ && doSimHits_) {
346  sprintf (name, "SimHitEn%s", detectorBeam_.c_str());
347  sprintf (title,"Sim Hit Energy for %s", detectorBeam_.c_str());
348  hSimHitE_[3] = fs_->make<TH1D>(name,title,100000,0.,0.2);
349  sprintf (name, "SimHitEnX%s", detectorBeam_.c_str());
350  sprintf (title,"Sim Hit Energy for %s", detectorBeam_.c_str());
351  hSimHitEn_[3] = fs_->make<TH1D>(name,title,100000,0.,0.2);
352  sprintf (name, "SimHitTm%s", detectorBeam_.c_str());
353  sprintf (title,"Sim Hit Timing for %s", detectorBeam_.c_str());
354  hSimHitT_[3] = fs_->make<TH1D>(name,title,5000,0.,500.0);
355  }
356  if (doSimHits_ && doTree_) {
357  tree_ = fs_->make<TTree>("HGCTB","SimHitEnergy");
358  tree_->Branch("simHitLayEn1EE", &simHitLayEn1EE_);
359  tree_->Branch("simHitLayEn2EE", &simHitLayEn2EE_);
360  tree_->Branch("simHitLayEn1FH", &simHitLayEn1FH_);
361  tree_->Branch("simHitLayEn2FH", &simHitLayEn2FH_);
362  tree_->Branch("simHitLayEn1BH", &simHitLayEn1BH_);
363  tree_->Branch("simHitLayEn2BH", &simHitLayEn2BH_);
364  tree_->Branch("xBeam", &xBeam_, "xBeam/D");
365  tree_->Branch("yBeam", &yBeam_, "yBeam/D");
366  tree_->Branch("zBeam", &zBeam_, "zBeam/D");
367  tree_->Branch("pBeam", &pBeam_, "pBeam/D");
368  if (doTreeCell_) {
369  tree_->Branch("simHitCellIdEE", &simHitCellIdEE_);
370  tree_->Branch("simHitCellEnEE", &simHitCellEnEE_);
371  tree_->Branch("simHitCellIdFH", &simHitCellIdFH_);
372  tree_->Branch("simHitCellEnFH", &simHitCellEnFH_);
373  tree_->Branch("simHitCellIdBH", &simHitCellIdBH_);
374  tree_->Branch("simHitCellEnBH", &simHitCellEnBH_);
375  tree_->Branch("simHitCellIdBeam", &simHitCellIdBeam_);
376  tree_->Branch("simHitCellEnBeam", &simHitCellEnBeam_);
377  }
378  }
379 
380  if (doPassive_ && doTree_) {
381  tree_->Branch("hgcPassiveEEEnergy", &hgcPassiveEEEnergy_);
382  tree_->Branch("hgcPassiveEEName", &hgcPassiveEEName_);
383  tree_->Branch("hgcPassiveEEID", &hgcPassiveEEID_);
384  tree_->Branch("hgcPassiveFHEnergy", &hgcPassiveFHEnergy_);
385  tree_->Branch("hgcPassiveFHName", &hgcPassiveFHName_);
386  tree_->Branch("hgcPassiveFHID", &hgcPassiveFHID_);
387  tree_->Branch("hgcPassiveBHEnergy", &hgcPassiveBHEnergy_);
388  tree_->Branch("hgcPassiveBHName", &hgcPassiveBHName_);
389  tree_->Branch("hgcPassiveBHID", &hgcPassiveBHID_);
390  tree_->Branch("hgcPassiveCMSEEnergy", &hgcPassiveCMSEEnergy_);
391  tree_->Branch("hgcPassiveCMSEName", &hgcPassiveCMSEName_);
392  tree_->Branch("hgcPassiveCMSEID", &hgcPassiveCMSEID_);
393  }
394 }
std::string detectorEE_
std::vector< float > simHitLayEn2EE_
std::vector< float > simHitLayEn2BH_
std::vector< uint32_t > simHitCellIdFH_
std::string detectorBH_
TProfile * hSimHitLng1_[3]
TProfile * hSimHitLng2_[3]
TProfile * hRecHitLng_[3]
std::vector< std::string > hgcPassiveFHName_
std::vector< float > simHitLayEn1EE_
std::vector< float > hgcPassiveBHEnergy_
std::string detectorFH_
edm::Service< TFileService > fs_
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
std::vector< std::string > hgcPassiveBHName_
std::vector< float > hgcPassiveCMSEEnergy_
std::vector< int > hgcPassiveEEID_
std::vector< float > hgcPassiveEEEnergy_
std::vector< float > simHitCellEnFH_
TProfile2D * hSimHitLat_[3]
std::vector< std::string > hgcPassiveCMSEName_
std::vector< uint32_t > simHitCellIdBH_
std::vector< float > hgcPassiveFHEnergy_
std::vector< int > hgcPassiveCMSEID_
TProfile2D * hRecHitLat_[3]
std::vector< float > simHitCellEnBeam_
TProfile * hSimHitLng_[3]
std::vector< std::string > hgcPassiveEEName_
std::string detectorBeam_
std::vector< int > hgcPassiveBHID_
std::vector< float > simHitLayEn1FH_
std::vector< int > hgcPassiveFHID_
std::vector< float > simHitCellEnBH_
std::vector< float > simHitLayEn1BH_
std::vector< uint32_t > simHitCellIdEE_
std::vector< float > simHitCellEnEE_
std::vector< uint32_t > simHitCellIdBeam_
std::vector< float > simHitLayEn2FH_
TProfile * hRecHitLng1_[3]
void HGCalTBAnalyzer::beginRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Definition at line 396 of file HGCalTBAnalyzer.cc.

References gather_cfg::cout, detectorBeam_, detectorBH_, detectorEE_, detectorFH_, doDigis_, doRecHits_, fs_, relativeConstraints::geom, edm::EventSetup::get(), hgcons_, hgeom_, hSimHitLayEn1BH_, hSimHitLayEn1EE_, hSimHitLayEn1FH_, hSimHitLayEn2BH_, hSimHitLayEn2EE_, hSimHitLayEn2FH_, hSimHitLayEnBeam_, idBeams_, ifBeam_, ifBH_, ifEE_, ifFH_, checklumidiff::l, HGCalDDDConstants::layers(), TFileService::make(), AHCalDetId::MaxDepth, dataset::name, edm::ESHandle< T >::product(), and fftjetcommon_cfi::title.

396  {
397 
398  char name[40], title[100];
399  if (ifEE_) {
401  iSetup.get<IdealGeometryRecord>().get(detectorEE_, pHGDC);
402  hgcons_[0] = &(*pHGDC);
403  if (doDigis_ || doRecHits_) {
405  iSetup.get<IdealGeometryRecord>().get(detectorEE_, geom);
406  hgeom_[0] = geom.product();
407  } else {
408  hgeom_[0] = 0;
409  }
410  for (unsigned int l=0; l<hgcons_[0]->layers(false); ++l) {
411  sprintf (name, "SimHitEnA%d%s", l, detectorEE_.c_str());
412  sprintf (title,"Sim Hit Energy in SIM layer %d for %s",l+1,
413  detectorEE_.c_str());
414  hSimHitLayEn1EE_.push_back(fs_->make<TH1D>(name,title,100000,0.,0.2));
415  if (l%3 == 0) {
416  sprintf (name, "SimHitEnB%d%s", (l/3+1), detectorEE_.c_str());
417  sprintf (title,"Sim Hit Energy in layer %d for %s",(l/3+1),
418  detectorEE_.c_str());
419  hSimHitLayEn2EE_.push_back(fs_->make<TH1D>(name,title,100000,0.,0.2));
420  }
421  }
422 #ifdef EDM_ML_DEBUG
423  std::cout << "HGCalTBAnalyzer::" << detectorEE_ << " defined with "
424  << hgcons_[0]->layers(false) << " layers" << std::endl;
425 #endif
426  } else {
427  hgcons_[0] = 0;
428  hgeom_[0] = 0;
429  }
430 
431  if (ifFH_) {
433  iSetup.get<IdealGeometryRecord>().get(detectorFH_, pHGDC);
434  hgcons_[1] = &(*pHGDC);
435  if (doDigis_ || doRecHits_) {
437  iSetup.get<IdealGeometryRecord>().get(detectorFH_, geom);
438  hgeom_[1] = geom.product();
439  } else {
440  hgeom_[1] = 0;
441  }
442  for (unsigned int l=0; l<hgcons_[1]->layers(false); ++l) {
443  sprintf (name, "SimHitEnA%d%s", l, detectorFH_.c_str());
444  sprintf (title,"Sim Hit Energy in layer %d for %s",l+1,
445  detectorFH_.c_str());
446  hSimHitLayEn1FH_.push_back(fs_->make<TH1D>(name,title,100000,0.,0.2));
447  if (l%3 == 0) {
448  sprintf (name, "SimHitEnB%d%s", (l/3+1), detectorFH_.c_str());
449  sprintf (title,"Sim Hit Energy in layer %d for %s",(l/3+1),
450  detectorFH_.c_str());
451  hSimHitLayEn2FH_.push_back(fs_->make<TH1D>(name,title,100000,0.,0.2));
452  }
453  }
454 #ifdef EDM_ML_DEBUG
455  std::cout << "HGCalTBAnalyzer::" << detectorFH_ << " defined with "
456  << hgcons_[1]->layers(false) << " layers" << std::endl;
457 #endif
458  } else {
459  hgcons_[1] = 0;
460  hgeom_[1] = 0;
461  }
462 
463  if (ifBH_) {
464  for (int l=0; l<AHCalDetId::MaxDepth; ++l) {
465  sprintf (name, "SimHitEnA%d%s", l, detectorBH_.c_str());
466  sprintf (title,"Sim Hit Energy in layer %d for %s",l+1,
467  detectorBH_.c_str());
468  hSimHitLayEn1BH_.push_back(fs_->make<TH1D>(name,title,100000,0.,0.2));
469  sprintf (name, "SimHitEnB%d%s", l, detectorBH_.c_str());
470  sprintf (title,"Sim Hit Energy in layer %d for %s",l+1,
471  detectorBH_.c_str());
472  hSimHitLayEn2BH_.push_back(fs_->make<TH1D>(name,title,100000,0.,0.2));
473  }
474  }
475 
476  if (ifBeam_) {
477  for (unsigned int l=0; l<idBeams_.size(); ++l) {
478  sprintf (name, "SimHitEna%d%s", l, detectorBeam_.c_str());
479  sprintf (title, "Sim Hit Energy in type %d for %s",idBeams_[l],
480  detectorBeam_.c_str());
481  hSimHitLayEnBeam_.push_back(fs_->make<TH1D>(name,title,100000,0.,0.2));
482  }
483  }
484 }
std::vector< TH1D * > hSimHitLayEn2EE_
std::string detectorEE_
std::string detectorBH_
static const int MaxDepth
get the layer number
Definition: AHCalDetId.h:41
std::string detectorFH_
edm::Service< TFileService > fs_
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
std::vector< TH1D * > hSimHitLayEn1EE_
std::vector< TH1D * > hSimHitLayEn2BH_
unsigned int layers(bool reco) const
std::vector< int > idBeams_
const HGCalGeometry * hgeom_[2]
std::vector< TH1D * > hSimHitLayEnBeam_
const HGCalDDDConstants * hgcons_[2]
std::vector< TH1D * > hSimHitLayEn1FH_
std::string detectorBeam_
std::vector< TH1D * > hSimHitLayEn1BH_
T const * product() const
Definition: ESHandle.h:86
std::vector< TH1D * > hSimHitLayEn2FH_
virtual void HGCalTBAnalyzer::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
inlineoverrideprivatevirtual
void HGCalTBAnalyzer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 233 of file HGCalTBAnalyzer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addUntracked(), edm::ParameterSetDescription::setUnknown(), and AlCaHLTBitMon_QueryRunRegistry::string.

233  {
235  desc.setUnknown();
236  desc.add<std::string>("DetectorEE","HGCalEESensitive");
237  desc.add<bool>("UseEE",true);
238  desc.add<double>("ZFrontEE",0.0);
239  desc.add<std::string>("CaloHitSrcEE","HGCHitsEE");
240  desc.add<edm::InputTag>("DigiSrcEE",edm::InputTag("mix","HGCDigisEE"));
241  desc.add<edm::InputTag>("RecHitSrcEE",edm::InputTag("HGCalRecHit","HGCEERecHits"));
242  desc.add<std::string>("DetectorFH","HGCalHESiliconSensitive");
243  desc.add<bool>("UseFH",false);
244  desc.add<double>("ZFrontFH",0.0);
245  desc.add<std::string>("CaloHitSrcFH","HGCHitsHEfront");
246  desc.add<edm::InputTag>("DigiSrcFH",edm::InputTag("mix","HGCDigisHEfront"));
247  desc.add<edm::InputTag>("RecHitSrcFH",edm::InputTag("HGCalRecHit","HGCHEFRecHits"));
248  desc.add<std::string>("DetectorBH","AHCal");
249  desc.add<bool>("UseBH",false);
250  desc.add<double>("ZFrontBH",0.0);
251  desc.add<std::string>("CaloHitSrcBH","HcalHits");
252  desc.add<edm::InputTag>("DigiSrcBH",edm::InputTag("mix","HGCDigisHEback"));
253  desc.add<edm::InputTag>("RecHitSrcBH",edm::InputTag("HGCalRecHit","HGCHEBRecHits"));
254  desc.add<std::string>("DetectorBeam","HcalTB06BeamDetector");
255  desc.add<bool>("UseBeam",false);
256  desc.add<std::string>("CaloHitSrcBeam","HcalTB06BeamHits");
257  std::vector<int> ids = {1000,1001,1002,1003,1004,1005,1006,1007,1008,1011,1012,1013,1014,2001,2002,2003,2004,2005};
258  desc.add<std::vector<int>>("IDBeams",ids);
259  desc.add<edm::InputTag>("GeneratorSrc",edm::InputTag("generatorSmeared"));
260  desc.add<edm::InputTag>("HGCPassiveEE",edm::InputTag("g4SimHits","HGCalEEPassiveHits"));
261  desc.add<edm::InputTag>("HGCPassiveFH",edm::InputTag("g4SimHits","HGCalHEPassiveHits"));
262  desc.add<edm::InputTag>("HGCPassiveBH",edm::InputTag("g4SimHits","HGCalAHPassiveHits"));
263  desc.add<edm::InputTag>("HGCPassiveCMSE",edm::InputTag("g4SimHits","CMSEPassiveHits"));
264 
265  desc.add<bool>("DoSimHits",true);
266  desc.add<bool>("DoDigis",true);
267  desc.add<bool>("DoRecHits",true);
268  desc.add<int>("SampleIndex",0);
269  desc.addUntracked<bool>("DoTree",true);
270  desc.addUntracked<bool>("DoTreeCell",true);
271  desc.addUntracked<bool>("DoPassive",false);
272 
273  descriptions.add("HGCalTBAnalyzer",desc);
274 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

Member Data Documentation

std::string HGCalTBAnalyzer::detectorBeam_
private

Definition at line 84 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), beginJob(), beginRun(), and HGCalTBAnalyzer().

std::string HGCalTBAnalyzer::detectorBH_
private

Definition at line 84 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), beginJob(), beginRun(), and HGCalTBAnalyzer().

std::string HGCalTBAnalyzer::detectorEE_
private

Definition at line 83 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), beginJob(), beginRun(), and HGCalTBAnalyzer().

std::string HGCalTBAnalyzer::detectorFH_
private

Definition at line 83 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), beginJob(), beginRun(), and HGCalTBAnalyzer().

bool HGCalTBAnalyzer::doDigis_
private

Definition at line 81 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), beginJob(), beginRun(), and HGCalTBAnalyzer().

bool HGCalTBAnalyzer::doPassive_
private

Definition at line 82 of file HGCalTBAnalyzer.cc.

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

bool HGCalTBAnalyzer::doRecHits_
private

Definition at line 81 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), beginJob(), beginRun(), and HGCalTBAnalyzer().

bool HGCalTBAnalyzer::doSimHits_
private

Definition at line 81 of file HGCalTBAnalyzer.cc.

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

bool HGCalTBAnalyzer::doTree_
private

Definition at line 80 of file HGCalTBAnalyzer.cc.

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

bool HGCalTBAnalyzer::doTreeCell_
private

Definition at line 80 of file HGCalTBAnalyzer.cc.

Referenced by beginJob(), and HGCalTBAnalyzer().

edm::Service<TFileService> HGCalTBAnalyzer::fs_
private

Definition at line 76 of file HGCalTBAnalyzer.cc.

Referenced by beginJob(), and beginRun().

TH1D * HGCalTBAnalyzer::hBeam_
private

Definition at line 101 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and beginJob().

TH1D* HGCalTBAnalyzer::hDigiADC_[3]
private

Definition at line 100 of file HGCalTBAnalyzer.cc.

Referenced by analyzeDigi(), and beginJob().

TH1D * HGCalTBAnalyzer::hDigiLng_[2]
private

Definition at line 100 of file HGCalTBAnalyzer.cc.

Referenced by analyzeDigi(), and beginJob().

TH2D* HGCalTBAnalyzer::hDigiOcc_[3]
private

Definition at line 102 of file HGCalTBAnalyzer.cc.

Referenced by analyzeDigi(), and beginJob().

const HGCalDDDConstants* HGCalTBAnalyzer::hgcons_[2]
private

Definition at line 77 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), analyzeRecHits(), analyzeSimHits(), and beginRun().

std::vector<float> HGCalTBAnalyzer::hgcPassiveBHEnergy_
private

Definition at line 120 of file HGCalTBAnalyzer.cc.

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

std::vector<int> HGCalTBAnalyzer::hgcPassiveBHID_
private

Definition at line 122 of file HGCalTBAnalyzer.cc.

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

std::vector<std::string> HGCalTBAnalyzer::hgcPassiveBHName_
private

Definition at line 121 of file HGCalTBAnalyzer.cc.

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

std::vector<float> HGCalTBAnalyzer::hgcPassiveCMSEEnergy_
private

Definition at line 120 of file HGCalTBAnalyzer.cc.

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

std::vector<int> HGCalTBAnalyzer::hgcPassiveCMSEID_
private

Definition at line 122 of file HGCalTBAnalyzer.cc.

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

std::vector<std::string> HGCalTBAnalyzer::hgcPassiveCMSEName_
private

Definition at line 121 of file HGCalTBAnalyzer.cc.

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

std::vector<float> HGCalTBAnalyzer::hgcPassiveEEEnergy_
private

Definition at line 120 of file HGCalTBAnalyzer.cc.

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

std::vector<int> HGCalTBAnalyzer::hgcPassiveEEID_
private

Definition at line 122 of file HGCalTBAnalyzer.cc.

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

std::vector<std::string> HGCalTBAnalyzer::hgcPassiveEEName_
private

Definition at line 121 of file HGCalTBAnalyzer.cc.

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

std::vector<float> HGCalTBAnalyzer::hgcPassiveFHEnergy_
private

Definition at line 120 of file HGCalTBAnalyzer.cc.

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

std::vector<int> HGCalTBAnalyzer::hgcPassiveFHID_
private

Definition at line 122 of file HGCalTBAnalyzer.cc.

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

std::vector<std::string> HGCalTBAnalyzer::hgcPassiveFHName_
private

Definition at line 121 of file HGCalTBAnalyzer.cc.

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

const HGCalGeometry* HGCalTBAnalyzer::hgeom_[2]
private

Definition at line 78 of file HGCalTBAnalyzer.cc.

Referenced by analyzeDigi(), analyzeRecHits(), and beginRun().

TH1D* HGCalTBAnalyzer::hRecHitE_[3]
private

Definition at line 101 of file HGCalTBAnalyzer.cc.

Referenced by analyzeRecHits(), and beginJob().

TProfile2D * HGCalTBAnalyzer::hRecHitLat_[3]
private

Definition at line 106 of file HGCalTBAnalyzer.cc.

Referenced by analyzeRecHits(), and beginJob().

TProfile * HGCalTBAnalyzer::hRecHitLng1_[3]
private

Definition at line 105 of file HGCalTBAnalyzer.cc.

Referenced by analyzeRecHits(), and beginJob().

TProfile* HGCalTBAnalyzer::hRecHitLng_[3]
private

Definition at line 105 of file HGCalTBAnalyzer.cc.

Referenced by analyzeRecHits(), and beginJob().

TH2D * HGCalTBAnalyzer::hRecHitOcc_[3]
private

Definition at line 102 of file HGCalTBAnalyzer.cc.

Referenced by analyzeRecHits(), and beginJob().

TH1D* HGCalTBAnalyzer::hSimHitE_[4]
private

Definition at line 99 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimHits(), and beginJob().

TH1D * HGCalTBAnalyzer::hSimHitEn_[4]
private

Definition at line 101 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimHits(), and beginJob().

TProfile2D* HGCalTBAnalyzer::hSimHitLat_[3]
private

Definition at line 106 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimHits(), and beginJob().

std::vector<TH1D*> HGCalTBAnalyzer::hSimHitLayEn1BH_
private

Definition at line 109 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimHits(), and beginRun().

std::vector<TH1D*> HGCalTBAnalyzer::hSimHitLayEn1EE_
private

Definition at line 107 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimHits(), and beginRun().

std::vector<TH1D*> HGCalTBAnalyzer::hSimHitLayEn1FH_
private

Definition at line 108 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimHits(), and beginRun().

std::vector<TH1D*> HGCalTBAnalyzer::hSimHitLayEn2BH_
private

Definition at line 109 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimHits(), and beginRun().

std::vector<TH1D*> HGCalTBAnalyzer::hSimHitLayEn2EE_
private

Definition at line 107 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimHits(), and beginRun().

std::vector<TH1D*> HGCalTBAnalyzer::hSimHitLayEn2FH_
private

Definition at line 108 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimHits(), and beginRun().

std::vector<TH1D*> HGCalTBAnalyzer::hSimHitLayEnBeam_
private

Definition at line 110 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimHits(), and beginRun().

TProfile * HGCalTBAnalyzer::hSimHitLng1_[3]
private

Definition at line 103 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimHits(), and beginJob().

TProfile* HGCalTBAnalyzer::hSimHitLng2_[3]
private

Definition at line 104 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimHits(), and beginJob().

TProfile* HGCalTBAnalyzer::hSimHitLng_[3]
private

Definition at line 103 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimHits(), and beginJob().

TH1D * HGCalTBAnalyzer::hSimHitT_[4]
private

Definition at line 99 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimHits(), and beginJob().

std::vector<int> HGCalTBAnalyzer::idBeams_
private

Definition at line 87 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), analyzeSimHits(), beginRun(), and HGCalTBAnalyzer().

bool HGCalTBAnalyzer::ifBeam_
private

Definition at line 79 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), beginJob(), beginRun(), and HGCalTBAnalyzer().

bool HGCalTBAnalyzer::ifBH_
private

Definition at line 79 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), beginJob(), beginRun(), and HGCalTBAnalyzer().

bool HGCalTBAnalyzer::ifEE_
private

Definition at line 79 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), beginJob(), beginRun(), and HGCalTBAnalyzer().

bool HGCalTBAnalyzer::ifFH_
private

Definition at line 79 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), beginJob(), beginRun(), and HGCalTBAnalyzer().

double HGCalTBAnalyzer::pBeam_
private

Definition at line 124 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimTracks(), and beginJob().

int HGCalTBAnalyzer::sampleIndex_
private

Definition at line 86 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

std::vector<float> HGCalTBAnalyzer::simHitCellEnBeam_
private

Definition at line 118 of file HGCalTBAnalyzer.cc.

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

std::vector<float> HGCalTBAnalyzer::simHitCellEnBH_
private

Definition at line 118 of file HGCalTBAnalyzer.cc.

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

std::vector<float> HGCalTBAnalyzer::simHitCellEnEE_
private

Definition at line 117 of file HGCalTBAnalyzer.cc.

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

std::vector<float> HGCalTBAnalyzer::simHitCellEnFH_
private

Definition at line 117 of file HGCalTBAnalyzer.cc.

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

std::vector<uint32_t> HGCalTBAnalyzer::simHitCellIdBeam_
private

Definition at line 116 of file HGCalTBAnalyzer.cc.

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

std::vector<uint32_t> HGCalTBAnalyzer::simHitCellIdBH_
private

Definition at line 116 of file HGCalTBAnalyzer.cc.

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

std::vector<uint32_t> HGCalTBAnalyzer::simHitCellIdEE_
private

Definition at line 115 of file HGCalTBAnalyzer.cc.

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

std::vector<uint32_t> HGCalTBAnalyzer::simHitCellIdFH_
private

Definition at line 115 of file HGCalTBAnalyzer.cc.

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

std::vector<float> HGCalTBAnalyzer::simHitLayEn1BH_
private

Definition at line 113 of file HGCalTBAnalyzer.cc.

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

std::vector<float> HGCalTBAnalyzer::simHitLayEn1EE_
private

Definition at line 111 of file HGCalTBAnalyzer.cc.

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

std::vector<float> HGCalTBAnalyzer::simHitLayEn1FH_
private

Definition at line 112 of file HGCalTBAnalyzer.cc.

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

std::vector<float> HGCalTBAnalyzer::simHitLayEn2BH_
private

Definition at line 113 of file HGCalTBAnalyzer.cc.

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

std::vector<float> HGCalTBAnalyzer::simHitLayEn2EE_
private

Definition at line 111 of file HGCalTBAnalyzer.cc.

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

std::vector<float> HGCalTBAnalyzer::simHitLayEn2FH_
private

Definition at line 112 of file HGCalTBAnalyzer.cc.

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

std::vector<float> HGCalTBAnalyzer::simHitLayEnBeam_
private

Definition at line 114 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and analyzeSimHits().

edm::EDGetToken HGCalTBAnalyzer::tok_digiBH_
private

Definition at line 92 of file HGCalTBAnalyzer.cc.

Referenced by HGCalTBAnalyzer().

edm::EDGetToken HGCalTBAnalyzer::tok_digiEE_
private

Definition at line 92 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

edm::EDGetToken HGCalTBAnalyzer::tok_digiFH_
private

Definition at line 92 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

edm::EDGetTokenT<edm::HepMCProduct> HGCalTBAnalyzer::tok_hepMC_
private

Definition at line 94 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

edm::EDGetTokenT<edm::PassiveHitContainer> HGCalTBAnalyzer::tok_hgcPHBH_
private

Definition at line 96 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

edm::EDGetTokenT<edm::PassiveHitContainer> HGCalTBAnalyzer::tok_hgcPHCMSE_
private

Definition at line 96 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

edm::EDGetTokenT<edm::PassiveHitContainer> HGCalTBAnalyzer::tok_hgcPHEE_
private

Definition at line 95 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

edm::EDGetTokenT<edm::PassiveHitContainer> HGCalTBAnalyzer::tok_hgcPHFH_
private

Definition at line 95 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

edm::EDGetToken HGCalTBAnalyzer::tok_hitrBH_
private

Definition at line 93 of file HGCalTBAnalyzer.cc.

Referenced by HGCalTBAnalyzer().

edm::EDGetToken HGCalTBAnalyzer::tok_hitrEE_
private

Definition at line 93 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

edm::EDGetToken HGCalTBAnalyzer::tok_hitrFH_
private

Definition at line 93 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

edm::EDGetTokenT<edm::PCaloHitContainer> HGCalTBAnalyzer::tok_hitsBeam_
private

Definition at line 89 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

edm::EDGetTokenT<edm::PCaloHitContainer> HGCalTBAnalyzer::tok_hitsBH_
private

Definition at line 89 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

edm::EDGetTokenT<edm::PCaloHitContainer> HGCalTBAnalyzer::tok_hitsEE_
private

Definition at line 88 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

edm::EDGetTokenT<edm::PCaloHitContainer> HGCalTBAnalyzer::tok_hitsFH_
private

Definition at line 88 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

edm::EDGetTokenT<edm::SimTrackContainer> HGCalTBAnalyzer::tok_simTk_
private

Definition at line 90 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

edm::EDGetTokenT<edm::SimVertexContainer> HGCalTBAnalyzer::tok_simVtx_
private

Definition at line 91 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

TTree* HGCalTBAnalyzer::tree_
private

Definition at line 98 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and beginJob().

double HGCalTBAnalyzer::xBeam_
private

Definition at line 124 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimTracks(), and beginJob().

double HGCalTBAnalyzer::yBeam_
private

Definition at line 124 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimTracks(), and beginJob().

double HGCalTBAnalyzer::zBeam_
private

Definition at line 124 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimTracks(), and beginJob().

double HGCalTBAnalyzer::zFrontBH_
private

Definition at line 85 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

double HGCalTBAnalyzer::zFrontEE_
private

Definition at line 85 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

double HGCalTBAnalyzer::zFrontFH_
private

Definition at line 85 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().