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 () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::SharedResources >
 EDAnalyzer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () 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
 
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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) 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

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)
 
void beginJob () override
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
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 53 of file HGCalTBAnalyzer.cc.

Constructor & Destructor Documentation

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

Passive hits

Definition at line 125 of file HGCalTBAnalyzer.cc.

References gather_cfg::cout, detectorBeam_, detectorBH_, detectorEE_, detectorFH_, doDigis_, doPassive_, doRecHits_, doSimHits_, doTree_, doTreeCell_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), triggerObjects_cff::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_.

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

Definition at line 229 of file HGCalTBAnalyzer.cc.

229 {}

Member Function Documentation

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

EE

FH

BH

CMSE

Implements edm::one::EDAnalyzerBase.

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

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

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

Referenced by analyze(), and endRun().

923  {
924 
925  DetId id1 = DetId(detId.rawId());
926  GlobalPoint global = hgeom_[type]->getPosition(id1);
927  hDigiOcc_[type]->Fill(global.x(),global.y());
928  hDigiLng_[type]->Fill(global.z());
929  hDigiADC_[type]->Fill(adc);
930 }
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 982 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().

982  {
983 
984  for (auto v : *hgcPH) {
985  double energy = v.energy();
986  std::string name = v.vname();
987  unsigned int id = v.id();
988 #ifdef EDM_ML_DEBUG
989  double time = v.time();
990  std::cout << "HGCalTBAnalyzer::analyzePassiveHits:Energy:Time:Name:Id : "
991  << energy << ":" << time << ":" << name << ":" << id
992  << std::endl;
993 #endif
994 
995  if (subdet==1) {
996  hgcPassiveEEEnergy_.push_back(energy);
997  hgcPassiveEEName_.push_back(name);
998  hgcPassiveEEID_.push_back(id);
999  } else if (subdet==2) {
1000  hgcPassiveFHEnergy_.push_back(energy);
1001  hgcPassiveFHName_.push_back(name);
1002  hgcPassiveFHID_.push_back(id);
1003  } else if (subdet==3) {
1004  hgcPassiveBHEnergy_.push_back(energy);
1005  hgcPassiveBHName_.push_back(name);
1006  hgcPassiveBHID_.push_back(id);
1007  } else if (subdet==4) {
1008  hgcPassiveCMSEEnergy_.push_back(energy);
1009  hgcPassiveCMSEName_.push_back(name);
1010  hgcPassiveCMSEID_.push_back(id);
1011  }
1012  }
1013 }
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 932 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().

933  {
934 
935  std::map<int,double> map_hitLayer;
936  std::map<int,std::pair<DetId,double> > map_hitCell;
937  for (auto it : *hits) {
938  DetId detId = it.id();
939  GlobalPoint global = hgeom_[type]->getPosition(detId);
940  double energy = it.energy();
941  int layer = HGCalDetId(detId).layer();
942  int cell = HGCalDetId(detId).cell();
943  hRecHitOcc_[type]->Fill(global.x(),global.y(),energy);
944  hRecHitE_[type]->Fill(energy);
945  if (map_hitLayer.count(layer) != 0) {
946  map_hitLayer[layer] += energy;
947  } else {
948  map_hitLayer[layer] = energy;
949  }
950  if (map_hitCell.count(cell) != 0) {
951  double ee = energy + map_hitCell[cell].second;
952  map_hitCell[cell] = std::pair<uint32_t,double>(detId,ee);
953  } else {
954  map_hitCell[cell] = std::pair<uint32_t,double>(detId,energy);
955  }
956 #ifdef EDM_ML_DEBUG
957  std::cout << "RecHit: " << layer << " " << global.x() << " " << global.y()
958  << " " << global.z() << " " << energy << std::endl;
959 #endif
960  }
961 
962  for (auto itr : map_hitLayer) {
963  int layer = itr.first;
964  double energy = itr.second;
965  double zp = hgcons_[type]->waferZ(layer,true);
966 #ifdef EDM_ML_DEBUG
967  std::cout << "SimHit:Layer " << layer << " " << zp << " " << energy
968  << std::endl;
969 #endif
970  hRecHitLng_[type]->Fill(zp,energy);
971  hRecHitLng1_[type]->Fill(layer,energy);
972  }
973 
974  for (auto itr : map_hitCell) {
975  DetId detId = ((itr.second).first);
976  double energy = ((itr.second).second);
977  GlobalPoint global = hgeom_[type]->getPosition(detId);
978  hRecHitLat_[type]->Fill(global.x(),global.y(),energy);
979  }
980 }
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 711 of file HGCalTBAnalyzer.cc.

References gather_cfg::cout, egammaForCoreTracking_cff::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(), triggerObjects_cff::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, AHCalDetId::zside(), and ecaldqm::zside().

Referenced by analyze(), and endRun().

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

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

Referenced by analyze(), and endRun().

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

Reimplemented from edm::one::EDAnalyzerBase.

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

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

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

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

Definition at line 231 of file HGCalTBAnalyzer.cc.

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

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

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

std::string HGCalTBAnalyzer::detectorBH_
private

Definition at line 82 of file HGCalTBAnalyzer.cc.

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

std::string HGCalTBAnalyzer::detectorEE_
private

Definition at line 81 of file HGCalTBAnalyzer.cc.

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

std::string HGCalTBAnalyzer::detectorFH_
private

Definition at line 81 of file HGCalTBAnalyzer.cc.

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

bool HGCalTBAnalyzer::doDigis_
private

Definition at line 79 of file HGCalTBAnalyzer.cc.

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

bool HGCalTBAnalyzer::doPassive_
private

Definition at line 80 of file HGCalTBAnalyzer.cc.

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

bool HGCalTBAnalyzer::doRecHits_
private

Definition at line 79 of file HGCalTBAnalyzer.cc.

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

bool HGCalTBAnalyzer::doSimHits_
private

Definition at line 79 of file HGCalTBAnalyzer.cc.

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

bool HGCalTBAnalyzer::doTree_
private

Definition at line 78 of file HGCalTBAnalyzer.cc.

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

bool HGCalTBAnalyzer::doTreeCell_
private

Definition at line 78 of file HGCalTBAnalyzer.cc.

Referenced by beginJob(), and HGCalTBAnalyzer().

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

Definition at line 74 of file HGCalTBAnalyzer.cc.

Referenced by beginJob(), and beginRun().

TH1D * HGCalTBAnalyzer::hBeam_
private

Definition at line 99 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and beginJob().

TH1D* HGCalTBAnalyzer::hDigiADC_[3]
private

Definition at line 98 of file HGCalTBAnalyzer.cc.

Referenced by analyzeDigi(), and beginJob().

TH1D * HGCalTBAnalyzer::hDigiLng_[2]
private

Definition at line 98 of file HGCalTBAnalyzer.cc.

Referenced by analyzeDigi(), and beginJob().

TH2D* HGCalTBAnalyzer::hDigiOcc_[3]
private

Definition at line 100 of file HGCalTBAnalyzer.cc.

Referenced by analyzeDigi(), and beginJob().

const HGCalDDDConstants* HGCalTBAnalyzer::hgcons_[2]
private

Definition at line 75 of file HGCalTBAnalyzer.cc.

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

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

Definition at line 118 of file HGCalTBAnalyzer.cc.

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

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

Definition at line 120 of file HGCalTBAnalyzer.cc.

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

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

Definition at line 119 of file HGCalTBAnalyzer.cc.

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

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

Definition at line 118 of file HGCalTBAnalyzer.cc.

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

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

Definition at line 120 of file HGCalTBAnalyzer.cc.

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

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

Definition at line 119 of file HGCalTBAnalyzer.cc.

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

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

Definition at line 118 of file HGCalTBAnalyzer.cc.

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

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

Definition at line 120 of file HGCalTBAnalyzer.cc.

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

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

Definition at line 119 of file HGCalTBAnalyzer.cc.

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

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

Definition at line 118 of file HGCalTBAnalyzer.cc.

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

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

Definition at line 120 of file HGCalTBAnalyzer.cc.

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

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

Definition at line 119 of file HGCalTBAnalyzer.cc.

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

const HGCalGeometry* HGCalTBAnalyzer::hgeom_[2]
private

Definition at line 76 of file HGCalTBAnalyzer.cc.

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

TH1D* HGCalTBAnalyzer::hRecHitE_[3]
private

Definition at line 99 of file HGCalTBAnalyzer.cc.

Referenced by analyzeRecHits(), and beginJob().

TProfile2D * HGCalTBAnalyzer::hRecHitLat_[3]
private

Definition at line 104 of file HGCalTBAnalyzer.cc.

Referenced by analyzeRecHits(), and beginJob().

TProfile * HGCalTBAnalyzer::hRecHitLng1_[3]
private

Definition at line 103 of file HGCalTBAnalyzer.cc.

Referenced by analyzeRecHits(), and beginJob().

TProfile* HGCalTBAnalyzer::hRecHitLng_[3]
private

Definition at line 103 of file HGCalTBAnalyzer.cc.

Referenced by analyzeRecHits(), and beginJob().

TH2D * HGCalTBAnalyzer::hRecHitOcc_[3]
private

Definition at line 100 of file HGCalTBAnalyzer.cc.

Referenced by analyzeRecHits(), and beginJob().

TH1D* HGCalTBAnalyzer::hSimHitE_[4]
private

Definition at line 97 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimHits(), and beginJob().

TH1D * HGCalTBAnalyzer::hSimHitEn_[4]
private

Definition at line 99 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimHits(), and beginJob().

TProfile2D* HGCalTBAnalyzer::hSimHitLat_[3]
private

Definition at line 104 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimHits(), and beginJob().

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

Definition at line 107 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimHits(), and beginRun().

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

Definition at line 105 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimHits(), and beginRun().

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

Definition at line 106 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimHits(), and beginRun().

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

Definition at line 107 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimHits(), and beginRun().

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

Definition at line 105 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimHits(), and beginRun().

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

Definition at line 106 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimHits(), and beginRun().

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

Definition at line 108 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimHits(), and beginRun().

TProfile * HGCalTBAnalyzer::hSimHitLng1_[3]
private

Definition at line 101 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimHits(), and beginJob().

TProfile* HGCalTBAnalyzer::hSimHitLng2_[3]
private

Definition at line 102 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimHits(), and beginJob().

TProfile* HGCalTBAnalyzer::hSimHitLng_[3]
private

Definition at line 101 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimHits(), and beginJob().

TH1D * HGCalTBAnalyzer::hSimHitT_[4]
private

Definition at line 97 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimHits(), and beginJob().

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

Definition at line 85 of file HGCalTBAnalyzer.cc.

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

bool HGCalTBAnalyzer::ifBeam_
private

Definition at line 77 of file HGCalTBAnalyzer.cc.

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

bool HGCalTBAnalyzer::ifBH_
private

Definition at line 77 of file HGCalTBAnalyzer.cc.

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

bool HGCalTBAnalyzer::ifEE_
private

Definition at line 77 of file HGCalTBAnalyzer.cc.

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

bool HGCalTBAnalyzer::ifFH_
private

Definition at line 77 of file HGCalTBAnalyzer.cc.

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

double HGCalTBAnalyzer::pBeam_
private

Definition at line 122 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimTracks(), and beginJob().

int HGCalTBAnalyzer::sampleIndex_
private

Definition at line 84 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

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

Definition at line 116 of file HGCalTBAnalyzer.cc.

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

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

Definition at line 116 of file HGCalTBAnalyzer.cc.

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

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

Definition at line 115 of file HGCalTBAnalyzer.cc.

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

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

Definition at line 115 of file HGCalTBAnalyzer.cc.

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

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

Definition at line 114 of file HGCalTBAnalyzer.cc.

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

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

Definition at line 114 of file HGCalTBAnalyzer.cc.

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

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

Definition at line 113 of file HGCalTBAnalyzer.cc.

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

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

Definition at line 113 of file HGCalTBAnalyzer.cc.

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

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

Definition at line 111 of file HGCalTBAnalyzer.cc.

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

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

Definition at line 109 of file HGCalTBAnalyzer.cc.

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

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

Definition at line 110 of file HGCalTBAnalyzer.cc.

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

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

Definition at line 111 of file HGCalTBAnalyzer.cc.

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

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

Definition at line 109 of file HGCalTBAnalyzer.cc.

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

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

Definition at line 110 of file HGCalTBAnalyzer.cc.

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

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

Definition at line 112 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and analyzeSimHits().

edm::EDGetToken HGCalTBAnalyzer::tok_digiBH_
private

Definition at line 90 of file HGCalTBAnalyzer.cc.

Referenced by HGCalTBAnalyzer().

edm::EDGetToken HGCalTBAnalyzer::tok_digiEE_
private

Definition at line 90 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

edm::EDGetToken HGCalTBAnalyzer::tok_digiFH_
private

Definition at line 90 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

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

Definition at line 92 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

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

Definition at line 94 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

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

Definition at line 94 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

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

Definition at line 93 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

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

Definition at line 93 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

edm::EDGetToken HGCalTBAnalyzer::tok_hitrBH_
private

Definition at line 91 of file HGCalTBAnalyzer.cc.

Referenced by HGCalTBAnalyzer().

edm::EDGetToken HGCalTBAnalyzer::tok_hitrEE_
private

Definition at line 91 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

edm::EDGetToken HGCalTBAnalyzer::tok_hitrFH_
private

Definition at line 91 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

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

Definition at line 87 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

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

Definition at line 87 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

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

Definition at line 86 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

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

Definition at line 86 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

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

Definition at line 88 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

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

Definition at line 89 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

TTree* HGCalTBAnalyzer::tree_
private

Definition at line 96 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and beginJob().

double HGCalTBAnalyzer::xBeam_
private

Definition at line 122 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimTracks(), and beginJob().

double HGCalTBAnalyzer::yBeam_
private

Definition at line 122 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimTracks(), and beginJob().

double HGCalTBAnalyzer::zBeam_
private

Definition at line 122 of file HGCalTBAnalyzer.cc.

Referenced by analyzeSimTracks(), and beginJob().

double HGCalTBAnalyzer::zFrontBH_
private

Definition at line 83 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

double HGCalTBAnalyzer::zFrontEE_
private

Definition at line 83 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().

double HGCalTBAnalyzer::zFrontFH_
private

Definition at line 83 of file HGCalTBAnalyzer.cc.

Referenced by analyze(), and HGCalTBAnalyzer().