20 HepMCLabel(ps.getParameter<
std::
string>(
"moduleLabelMC")),
21 g4InfoLabel(ps.getParameter<
std::
string>(
"moduleLabelG4")),
35 if ( verbose_ ) { dbe_->setVerbose(1); }
36 else { dbe_->setVerbose(0); }
40 if ( verbose_ ) dbe_->showDirStructure();
69 dbe_->setCurrentFolder(
"EcalHitsV/EcalSimHitsValidation");
71 sprintf (histo,
"ES hits layer 1 multiplicity z+" ) ;
74 sprintf (histo,
"ES hits layer 2 multiplicity z+" ) ;
77 sprintf (histo,
"ES hits layer 1 multiplicity z-" ) ;
80 sprintf (histo,
"ES hits layer 2 multiplicity z-" ) ;
83 sprintf (histo,
"ES hits energy layer 1 z+" ) ;
86 sprintf (histo,
"ES hits energy layer 2 z+" ) ;
89 sprintf (histo,
"ES hits energy layer 1 z-" ) ;
92 sprintf (histo,
"ES hits energy layer 2 z-" ) ;
95 sprintf (histo,
"ES hits log10energy spectrum" );
98 sprintf (histo,
"ES hits log10energy spectrum vs normalized energy" );
101 sprintf (histo,
"ES E1+07E2 z+" ) ;
104 sprintf (histo,
"ES E1+07E2 z-" ) ;
107 sprintf (histo,
"EE vs ES z+" ) ;
108 meEEoverESzp_ = dbe_->bookProfile(histo, histo, 250, 0., 500., 200, 0., 200.);
110 sprintf (histo,
"EE vs ES z-" ) ;
111 meEEoverESzm_ = dbe_->bookProfile(histo, histo, 250, 0., 500., 200, 0., 200.);
113 sprintf (histo,
"ES ene2oEne1 z+" ) ;
116 sprintf (histo,
"ES ene2oEne1 z-" ) ;
146 std::vector<PCaloHit> theEECaloHits;
148 theEECaloHits.insert(theEECaloHits.end(), EcalHitsEE->begin(), EcalHitsEE->end());
151 std::vector<PCaloHit> theESCaloHits;
153 theESCaloHits.insert(theESCaloHits.end(), EcalHitsES->begin(), EcalHitsES->end());
156 double ESEnergy_ = 0.;
162 for (std::vector<PCaloHit>::iterator isim = theEECaloHits.begin(); isim != theEECaloHits.end(); ++isim){
164 if (eeid.zside() > 0 ) EEetzp_ += isim->energy();
165 if (eeid.zside() < 0 ) EEetzm_ += isim->energy();
169 uint32_t nESHits1zp = 0;
170 uint32_t nESHits1zm = 0;
171 uint32_t nESHits2zp = 0;
172 uint32_t nESHits2zm = 0;
173 double ESet1zp_ = 0.;
174 double ESet2zp_ = 0.;
175 double ESet1zm_ = 0.;
176 double ESet2zm_ = 0.;
177 std::vector<double> econtr(140, 0. );
179 for (std::vector<PCaloHit>::iterator isim = theESCaloHits.begin();
180 isim != theESCaloHits.end(); ++isim){
186 <<
" CaloHit " << isim->getName() <<
"\n" 187 <<
" DetID = "<<isim->id()<<
" ESDetId: z side " << esid.zside() <<
" plane " << esid.plane() << esid.six() <<
',' << esid.siy() <<
':' << esid.strip() <<
"\n" 188 <<
" Time = " << isim->time() <<
"\n" 189 <<
" Track Id = " << isim->geantTrackId() <<
"\n" 190 <<
" Energy = " << isim->energy();
192 ESEnergy_ += isim->energy();
193 if( isim->energy() > 0 ) {
195 int log10i =
int( ( log10(isim->energy()) + 10. ) * 10. );
196 if( log10i >=0 && log10i < 140 ) econtr[log10i] += isim->energy();
199 if (esid.plane() == 1 ) {
200 if (esid.zside() > 0 ) {
202 ESet1zp_ += isim->energy();
205 else if (esid.zside() < 0 ) {
207 ESet1zm_ += isim->energy();
211 else if (esid.plane() == 2 ) {
212 if (esid.zside() > 0 ) {
214 ESet2zp_ += isim->energy();
217 else if (esid.zside() < 0 ) {
219 ESet2zm_ += isim->energy();
233 for(
int i=0;
i<140;
i++ ) {
239 for ( HepMC::GenEvent::particle_const_iterator
p = MCEvt->
GetEvent()->particles_begin();
240 p != MCEvt->
GetEvent()->particles_end(); ++
p ) {
242 double htheta = (*p)->momentum().theta();
243 double heta = -99999.;
244 if(
tan(htheta * 0.5) > 0 ) {
245 heta = -
log(
tan(htheta * 0.5));
248 if ( heta > 1.653 && heta < 2.6 ) {
254 if ( heta < -1.653 && heta > -2.6 ) {
MonitorElement * menESHits1zm_
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
std::string EEHitsCollection
EcalPreshowerSimHitsValidation(const edm::ParameterSet &ps)
Constructor.
MonitorElement * meEShitLog10EnergyNorm_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * me2eszmOver1eszm_
MonitorElement * meEEoverESzm_
MonitorElement * meE1alphaE2zm_
MonitorElement * me2eszpOver1eszp_
void endJob(void) override
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Analyze.
std::string ESHitsCollection
MonitorElement * menESHits2zm_
edm::EDGetTokenT< edm::HepMCProduct > HepMCToken
MonitorElement * meESEnergyHits2zm_
Tan< T >::type tan(const T &t)
MonitorElement * meESEnergyHits1zp_
MonitorElement * menESHits2zp_
Namespace of DDCMS conversion namespace.
MonitorElement * meESEnergyHits1zm_
const HepMC::GenEvent * GetEvent() const
MonitorElement * meE1alphaE2zp_
MonitorElement * meESEnergyHits2zp_
edm::EDGetTokenT< edm::PCaloHitContainer > EEHitsToken
edm::EDGetTokenT< edm::PCaloHitContainer > ESHitsToken
MonitorElement * meEEoverESzp_
MonitorElement * menESHits1zp_
MonitorElement * meEShitLog10Energy_
~EcalPreshowerSimHitsValidation() override
Destructor.