CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CastorShowerLibraryMaker.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: ShowerLibraryProducer
4 // Class : CastorShowerLibraryMaker
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: P. Katsas
10 // Created: 02/2007
11 //
12 // Adapted by W. Carvalho , 02/2009
13 //
21 
24 
26 
27 #include "TFile.h"
28 #include <cmath>
29 #include <iostream>
30 #include <sstream>
31 #include <iomanip>
32 #include <stdlib.h>
33 
35  NPGParticle(0),DoHadSL(false),DoEmSL(false),DeActivatePhysicsProcess(false),
36  emShower(NULL) , hadShower(NULL) {
37 
38  MapOfSecondaries.clear();
39  hadInfo = NULL;
40  emInfo = NULL;
41  edm::ParameterSet p_SLM = p.getParameter<edm::ParameterSet>("CastorShowerLibraryMaker");
42  verbosity = p_SLM.getParameter<int>("Verbosity");
43  eventNtFileName = p_SLM.getParameter<std::string>("EventNtupleFileName");
44  hadSLHolder.nEvtPerBinPhi = p_SLM.getParameter<int>("nhadEvents");
45  emSLHolder.nEvtPerBinPhi = p_SLM.getParameter<int>("nemEvents");
46  hadSLHolder.SLEnergyBins = p_SLM.getParameter<std::vector<double> >("SLhadEnergyBins");
47  hadSLHolder.SLEtaBins = p_SLM.getParameter<std::vector<double> >("SLhadEtaBins");
48  hadSLHolder.SLPhiBins = p_SLM.getParameter<std::vector<double> >("SLhadPhiBins");
49  emSLHolder.SLEnergyBins = p_SLM.getParameter<std::vector<double> >("SLemEnergyBins");
50  emSLHolder.SLEtaBins = p_SLM.getParameter<std::vector<double> >("SLemEtaBins");
51  emSLHolder.SLPhiBins = p_SLM.getParameter<std::vector<double> >("SLemPhiBins");
52  PGParticleIDs = p_SLM.getParameter<std::vector<int> >("PartID");
53  DeActivatePhysicsProcess = p_SLM.getParameter<bool>("DeActivatePhysicsProcess");
54  MaxPhi = p_SLM.getParameter<double>("SLMaxPhi");
55  MaxEta = p_SLM.getParameter<double>("SLMaxEta");
56 //
57  NPGParticle = PGParticleIDs.size();
58  for(unsigned int i=0;i<PGParticleIDs.size();i++) {
59  switch (int(fabs(PGParticleIDs.at(i)))) {
60  case 11:
61  case 22:
62  DoEmSL = true;
63  break;
64  default:
65  DoHadSL = true;
66  }
67  }
72 
73  std::cout << "============================================================================"<<std::endl;
74  std::cout << "CastorShowerLibraryMaker:: Initialized as observer" << std::endl;
75  std::cout << " Event Ntuple will be created" << std::endl;
76  std::cout << " Event Ntuple file: " << eventNtFileName << std::endl;
77  std::cout << " Number of Hadronic events in E bins: " << hadSLHolder.nEvtPerBinE << std::endl;
78  std::cout << " Number of Hadronic events in Eta bins: " << hadSLHolder.nEvtPerBinEta << std::endl;
79  std::cout << " Number of Hadronic events in Phi bins: " << hadSLHolder.nEvtPerBinPhi << std::endl;
80  std::cout << " Number of Electromag. events in E bins: " << emSLHolder.nEvtPerBinE << std::endl;
81  std::cout << " Number of Electromag. events in Eta bins: " << emSLHolder.nEvtPerBinEta << std::endl;
82  std::cout << " Number of Electromag. events in Phi bins: " << emSLHolder.nEvtPerBinPhi << std::endl;
83  std::cout << "============================================================================"<<std::endl;
84  std::cout << std::endl;
85 
86  // Initializing the SL collections
89 }
91 {
92  int nBinsE,nBinsEta,nBinsPhi,nEvtPerBinPhi;
93  nBinsE = showerholder.SLEnergyBins.size();
94  nBinsEta = showerholder.SLEtaBins.size();
95  nBinsPhi = showerholder.SLPhiBins.size();
96  nEvtPerBinPhi=showerholder.nEvtPerBinPhi;
97 //
98 // Info
99 //
100  showerholder.SLInfo.Energy.setNEvts(nEvtPerBinPhi*nBinsPhi*nBinsEta*nBinsE);
101  showerholder.SLInfo.Energy.setNEvtPerBin(nEvtPerBinPhi*nBinsPhi*nBinsEta);
102  showerholder.SLInfo.Energy.setNBins(nBinsE);
103  showerholder.SLInfo.Energy.setBin(showerholder.SLEnergyBins);
104 //
105  showerholder.SLInfo.Eta.setNEvts(nEvtPerBinPhi*nBinsPhi*nBinsEta);
106  showerholder.SLInfo.Eta.setNEvtPerBin(nEvtPerBinPhi*nBinsPhi);
107  showerholder.SLInfo.Eta.setNBins(nBinsEta);
108  showerholder.SLInfo.Eta.setBin(showerholder.SLEtaBins);
109 //
110  showerholder.SLInfo.Phi.setNEvts(nEvtPerBinPhi*nBinsPhi);
111  showerholder.SLInfo.Phi.setNEvtPerBin(nEvtPerBinPhi);
112  showerholder.SLInfo.Phi.setNBins(nBinsPhi);
113  showerholder.SLInfo.Phi.setBin(showerholder.SLPhiBins);
114 //
115 // Shower
116  showerholder.SLCollection.assign(nBinsE,std::vector<std::vector<std::vector<CastorShowerEvent> > >());
117  showerholder.nEvtInBinE.assign(nBinsE,0);
118  showerholder.nEvtInBinEta.assign(nBinsE,std::vector<int>(0));
119  showerholder.nEvtInBinPhi.assign(nBinsE,std::vector<std::vector<int> >());
120  for(int i=0;i<nBinsE;i++) {
121  showerholder.SLCollection.at(i).assign(nBinsEta,std::vector<std::vector<CastorShowerEvent> >());
122  showerholder.nEvtInBinEta.at(i).assign(nBinsEta,0);
123  showerholder.nEvtInBinPhi.at(i).assign(nBinsEta,std::vector<int>(0));
124  for(int j=0;j<nBinsEta;j++) {
125  showerholder.SLCollection.at(i).at(j).assign(nBinsPhi,std::vector<CastorShowerEvent>());
126  showerholder.nEvtInBinPhi.at(i).at(j).assign(nBinsPhi,0);
127  for(int k=0;k<nBinsPhi;k++)
128  showerholder.SLCollection.at(i).at(j).at(k).assign(nEvtPerBinPhi,CastorShowerEvent());
129  }
130  }
131 }
132 
133 //===============================================================================================
134 
136 
137  Finish();
138 
139  std::cout << "CastorShowerLibraryMaker: End of process" << std::endl;
140 
141 }
142 
143 //=================================================================== per EVENT
145 
146  std::cout << " CastorShowerLibraryMaker::Starting new job " << std::endl;
147 }
148 
149 //==================================================================== per RUN
151 
152  std::cout << std::endl << "CastorShowerLibraryMaker: Starting Run"<< std::endl;
153 
154  std::cout << "CastorShowerLibraryMaker: output event root file created" << std::endl;
155 
156  TString eventfilename = eventNtFileName;
157  theFile = new TFile(eventfilename,"RECREATE");
158  theTree = new TTree("CastorCherenkovPhotons", "Cherenkov Photons");
159 
160  Int_t split = 1;
161  Int_t bsize = 64000;
163  emShower = new CastorShowerEvent();
166  // Create Branchs
167  theTree->Branch("emShowerLibInfo.", "CastorShowerLibraryInfo", &emInfo, bsize, split);
168  theTree->Branch("emParticles.", "CastorShowerEvent", &emShower, bsize, split);
169  theTree->Branch("hadShowerLibInfo.", "CastorShowerLibraryInfo", &hadInfo, bsize, split);
170  theTree->Branch("hadParticles.", "CastorShowerEvent", &hadShower, bsize, split);
171 
172 // set the Info for electromagnetic shower
173 // set the energy bins info
178 // set the eta bins info
183 // set the eta bins info
188 // The same for the hadronic shower
189 // set the energy bins info
194 // set the eta bins info
199 // set the eta bins info
204  // int flag = theTree->GetBranch("CastorShowerLibInfo")->Fill();
205  // Loop on all leaves of this branch to fill Basket buffer.
206  // The function returns the number of bytes committed to the memory basket.
207  // If a write error occurs, the number of bytes returned is -1.
208  // If no data are written, because e.g. the branch is disabled,
209  // the number of bytes returned is 0.
210  // if(flag==-1) {
211  // edm::LogInfo("CastorAnalyzer") << " WARNING: Error writing to Branch \"CastorShowerLibInfo\" \n" ;
212  // } else
213  // if(flag==0) {
214  // edm::LogInfo("CastorAnalyzer") << " WARNING: No data written to Branch \"CastorShowerLibInfo\" \n" ;
215  // }
216 
217  // Initialize "accounting" variables
218 
219  eventIndex = 0;
220 
221 }
222 
223 //=================================================================== per EVENT
225 
226  eventIndex++;
227  stepIndex = 0;
228  InsideCastor = false;
229  PrimaryMomentum.clear();
230  PrimaryPosition.clear();
231  int NAccepted =0;
232 // reset the pointers to the shower objects
233  SLShowerptr = NULL;
234  MapOfSecondaries.clear();
235  thePrims.clear();
236  G4EventManager *e_mgr = G4EventManager::GetEventManager();
237  if (IsSLReady()) {
238  printSLstatus(-1,-1,-1);
239  update((EndOfRun*)NULL);
240  return;
241  }
242 
243  thePrims = GetPrimary((*evt)());
244  for(unsigned int i=0;i<thePrims.size();i++) {
245  G4PrimaryParticle* thePrim = thePrims.at(i);
246  int particleType = thePrim->GetPDGcode();
247 
248  std::string SLType("");
249  if (particleType==11) {
251  SLType = "Electromagnetic";
252  }
253  else {
255  SLType = "Hadronic";
256  }
257  double px=0., py=0., pz=0., pInit = 0., eta = 0., phi = 0.;
258  GetKinematics(thePrim,px,py,pz,pInit,eta,phi);
259  int ebin = FindEnergyBin(pInit);
260  int etabin= FindEtaBin(eta);
261  int phibin = FindPhiBin(phi);
262  if (verbosity)
263  std::cout << "\n========================================================================"
264  << "\nBeginOfEvent: E : " << pInit <<"\t bin : " << ebin
265  << "\n Eta : " << eta <<"\t bin : " << etabin
266  << "\n Phi : " << phi <<"\t bin : " << phibin
267  << "\n========================================================================"
268  << std::endl;
269 
270  if (ebin<0||etabin<0||phibin<0) continue;
271  bool accept=false;
272  if (!(SLacceptEvent(ebin,etabin,phibin))) {
273 /*
274 // To increase the chance of a particle arriving at CASTOR inside a not full bin,
275 // check if there is available phase space in the neighboring bins
276  unsigned int ebin_min = std::max(0,ebin-3);
277  unsigned int eta_bin_min = std::max(0,etabin-2);
278  unsigned int eta_bin_max = std::min(etabin,etabin+2);
279  unsigned int phi_bin_min = std::max(0,phibin-2);
280  unsigned int phi_bin_max = std::min(phibin,phibin+2);
281  for(unsigned int i_ebin=ebin_min;i_ebin<=(unsigned int)ebin;i_ebin++) {
282  for (unsigned int i_etabin=eta_bin_min;i_etabin<=eta_bin_max;i_etabin++) {
283  for (unsigned int i_phibin=phi_bin_min;i_phibin<=phi_bin_max;i_phibin++) {
284  if (SLacceptEvent((int)i_ebin,(int)i_etabin,(int)i_phibin)) {accept=true;break;}
285  }
286  if (accept) break;
287  }
288  if (accept) break;
289  }
290 */
291  if (!accept) edm::LogInfo("CastorShowerLibraryMaker") << "Event not accepted for ebin="
292  << ebin<<",etabin="<<etabin<<",phibin="<<phibin<<std::endl;
293  }
294  else {
295  accept=true;
296  }
297  if (accept) NAccepted++;
298  }
299 
300  if (NAccepted==0) {
301  const_cast<G4Event*>((*evt)())->SetEventAborted();
302  const_cast<G4Event*>((*evt)())->KeepTheEvent((G4bool)false);
303  e_mgr->AbortCurrentEvent();
304  }
306 //
307  std::cout << "CastorShowerLibraryMaker: Processing Event Number: " << eventIndex << std::endl;
308 }
309 
310 //=================================================================== per STEP
311 void CastorShowerLibraryMaker::update(const G4Step * aStep) {
312  static int CurrentPrimary = 0;
313  G4Track *trk = aStep->GetTrack();
314  if (trk->GetCurrentStepNumber()==1) {
315  if (trk->GetParentID()==0) {
316  CurrentPrimary = (int)trk->GetDynamicParticle()->GetPDGcode();
317  if (CurrentPrimary==0)
318  SimG4Exception("CastorShowerLibraryMaker::update(G4Step) -> Primary particle undefined");
319  InsideCastor=false;
320 // Deactivate the physics process
322  G4ProcessManager *p_mgr = trk->GetDefinition()->GetProcessManager();
323  G4ProcessVector *pvec = p_mgr->GetProcessList();
324  for (int i = 0;i<pvec->size();i++) {
325  G4VProcess *proc = (*pvec)(i);
326  if (proc->GetProcessName()!="Transportation"&&
327  proc->GetProcessName()!="Decay") {
328  std::cout << "DeActivating process: " << proc->GetProcessName() << std::endl;
329  p_mgr->SetProcessActivation(proc,false);
330  }
331  }
332  }
333 // move track to z of CASTOR
334  G4ThreeVector pos;
335  pos.setZ(-14390);
336  double t = abs((pos.z()-trk->GetPosition().z()))/trk->GetVelocity();
337  double r = (pos.z()-trk->GetPosition().z())/trk->GetMomentum().cosTheta();
338  pos.setX(r*sin(trk->GetMomentum().theta())*cos(trk->GetMomentum().phi())+trk->GetPosition().x());
339  pos.setY(r*sin(trk->GetMomentum().theta())*sin(trk->GetMomentum().phi())+trk->GetPosition().y());
340  trk->SetPosition(pos);
341  trk->SetGlobalTime(trk->GetGlobalTime()+t);
342  trk->AddTrackLength(r);
343  }
344  else if (!InsideCastor) {
345  std::cout<<"CastorShowerLibraryMaker::update(G4Step) -> Killing spurious track" << std::endl;
346  trk->SetTrackStatus(fKillTrackAndSecondaries);
347  return;
348  }
349  MapOfSecondaries[CurrentPrimary].insert((int)trk->GetTrackID());
350  }
351 // Checks if primary already inside CASTOR
352  std::string CurVolume = trk->GetVolume()->GetName();
353  if (!InsideCastor&&(
354  //CurVolume=="C3EF"||CurVolume=="C4EF"||CurVolume=="CAEL"||
355  //CurVolume=="CAHL"||CurVolume=="C3HF"||CurVolume=="C4HF")) {
356  //CurVolume=="CastorB"||
357  CurVolume=="CAST")) {
358  //CurVolume=="CAIR")) {
359  InsideCastor=true;
360 // Activate the physics process
361  if (trk->GetParentID()==0&&DeActivatePhysicsProcess) {
362  G4ProcessManager *p_mgr = trk->GetDefinition()->GetProcessManager();
363  G4ProcessVector *pvec = p_mgr->GetProcessList();
364  for (int i = 0;i<pvec->size();i++) {
365  G4VProcess *proc = (*pvec)(i);
366  if (proc->GetProcessName()!="Transportation"&&
367  proc->GetProcessName()!="Decay") {
368  std::cout << " Activating process: " << proc->GetProcessName() << std::endl;
369  p_mgr->SetProcessActivation(proc,true);
370  }
371  }
372  }
373  //PrimaryMomentum[CurrentPrimary]=aStep->GetPreStepPoint()->GetMomentum();
374 // check fiducial eta and phi
375  if (trk->GetMomentum().phi()>MaxPhi||trk->GetMomentum().eta()>MaxEta) {
376  trk->SetTrackStatus(fKillTrackAndSecondaries);
377  InsideCastor=false;
378  return;
379  }
380  PrimaryMomentum[CurrentPrimary]=trk->GetMomentum();
381  PrimaryPosition[CurrentPrimary]=trk->GetPosition();
382  KillSecondaries(aStep);
383  return;
384  }
385 // Kill the secondaries if they have been produced before entering castor
386  if (CurrentPrimary!=0&&trk->GetParentID()==0&&!InsideCastor) {
387  KillSecondaries(aStep);
388  if (verbosity) {
389  double pre_phi = aStep->GetPreStepPoint()->GetMomentum().phi();
390  double cur_phi = trk->GetMomentum().phi();
391  if (pre_phi!=cur_phi) {
392  std::cout << "Primary track phi : " << pre_phi << " changed in current step: "
393  << cur_phi << " by processes:" << std::endl;
394  const G4VProcess *proc = aStep->GetPreStepPoint()->GetProcessDefinedStep();
395  std::cout << " " << proc->GetProcessName()
396  << " In volume " << CurVolume << std::endl;
397  }
398  }
399  }
400 
401 //==============================================
402 /*
403 */
404 /*
405  if(aStep->IsFirstStepInVolume()) {
406  edm::LogInfo("CastorShowerLibraryMaker") << "CastorShowerLibraryMaker::update(const G4Step * aStep):"
407  << "\n IsFirstStepInVolume , "
408  << "time = " << aStep->GetTrack()->GetGlobalTime() ;
409  }
410  stepIndex++;
411 */
412 }
413 
414 //================= End of EVENT ===============
416 
417 // check if the job is done!
418  if ((*evt)()->IsAborted()) {
419  std::cout << "\n========================================================================"
420  << "\nEndOfEvent: EVENT ABORTED"
421  << "\n========================================================================"
422  << std::endl;
423  return;
424  }
425  //DynamicRangeFlatRandomEGunProducer* pgun = edm::DynamicRangeFlatRandomEGunKernel::get_instance();
426  //std::cout << pgun->EGunMaxE() << std::endl;
427 /*
428  std::cout << "Minimum energy in Particle Gun : " << pgun->EGunMinE() << "\n"
429  << "Maximum energy in Particle Gun : " << pgun->EGunMaxE() << std::endl;
430 */
431  if (verbosity)
432  std::cout << "CastorShowerLibraryMaker: End of Event: " << eventIndex << std::endl;
433 // Get the pointer to the primary particle
434  if (thePrims.size() == 0) {
435  edm::LogInfo("CastorShowerLibraryMaker") << "No valid primary particle found. Skipping event" << std::endl;
436  return;
437  }
438  // access to the G4 hit collections
439  G4HCofThisEvent* allHC = (*evt)()->GetHCofThisEvent();
440  int CAFIid = G4SDManager::GetSDMpointer()->GetCollectionID("CastorFI");
441  CaloG4HitCollection* theCAFI = (CaloG4HitCollection*) allHC->GetHC(CAFIid);
442  if (verbosity) edm::LogInfo("CastorShowerLibraryMaker") << " update(*evt) --> accessed all HC ";
443  edm::LogInfo("CastorShowerLibraryMaker") << "Found "<<theCAFI->entries() << " hits in G4HitCollection";
444  if (theCAFI->entries()== 0) {
445  edm::LogInfo("CastorShowerLibraryMaker") << "\n Empty G4HitCollection";
446  return;
447  }
448 
449 // Loop over primaries
450  int NEvtAccepted = 0;
451  int NHitInEvent = 0;
452  for(unsigned int i=0;i<thePrims.size();i++) {
453  G4PrimaryParticle* thePrim = thePrims.at(i);
454  if (!thePrim) {
455  edm::LogInfo("CastorShowerLibraryMaker") << "NULL Pointer to the primary" << std::endl;
456  continue;
457  }
458 // Check primary particle type
459  int particleType = thePrim->GetPDGcode();
460 
461 // set the pointer to the shower collection
462  std::string SLType("");
463  if (particleType==11) {
465  SLType = "Electromagnetic";
466  }
467  else {
469  SLType = "Hadronic";
470  }
471  edm::LogInfo("CastorShowerLibraryMaker") << "\n Primary (thePrim) trackID is " << thePrim->GetTrackID() << "\n" ;
472 
473 // Obtain primary particle's initial momentum (pInit)
474  double px=0., py=0., pz=0., pInit = 0., eta = 0., phi = 0.;
475  GetKinematics(particleType,px,py,pz,pInit,eta,phi);
476 // Check if current event falls into any bin
477 // first: energy
478  if (pInit==0) {
479  edm::LogInfo("CastorShowerLibraryMaker") << "Primary did not hit CASTOR" << std::endl;
480  continue;
481  }
482  int ebin = FindEnergyBin(pInit);
483  int etabin= FindEtaBin(eta);
484  int phibin = FindPhiBin(phi);
485  std::cout << SLType << std::endl;
486  printSLstatus(ebin,etabin,phibin);
487  if (!SLacceptEvent(ebin,etabin,phibin)) {
488  edm::LogInfo("CastorShowerLibraryMaker") << "Event not accepted for ebin="
489  << ebin<<",etabin="<<etabin<<",phibin="<<phibin
490  <<"("<< pInit <<","<<eta<<","<<phi<<")" <<std::endl;
491  continue;
492  }
493 //
494 // event passed. Fill the vector accordingly
495 //
496 // Look for the Hit Collection
497  edm::LogInfo("CastorShowerLibraryMaker")
498  << "\n CastorShowerLibraryMaker::update(EndOfEvent * evt) - event #"
499  << (*evt)()->GetEventID() ;
500 
501 /*
502  std::cout << "Number of collections : " << allHC->GetNumberOfCollections() << std::endl;
503  for(int ii = 0;ii<allHC->GetNumberOfCollections();ii++)
504  std::cout << "Name of collection " << ii << " : " << allHC->GetHC(ii)->GetName() << std::endl;
505 */
506 
507  CastorShowerEvent* shower=NULL;
508  int cur_evt_idx = SLShowerptr->nEvtInBinPhi.at(ebin).at(etabin).at(phibin);
509  shower = &(SLShowerptr->SLCollection.at(ebin).at(etabin).at(phibin).at(cur_evt_idx));
510 
511 // Get Hit information
512  if (FillShowerEvent(theCAFI,shower,particleType)) {
513 // Primary particle information
514 /*
515  edm::LogInfo("CastorShowerLibraryMaker") << "New SL event: Primary = " << particleType
516  << "; Energy = " << pInit << "; Eta = " << eta << "; Phi = " << phi
517  << "; Nhits = " << shower->getNhit() << std::endl;
518 */
519  shower->setPrimE(pInit);
520  shower->setPrimEta(eta);
521  shower->setPrimPhi(phi);
522  shower->setPrimX(PrimaryPosition[particleType].x());
523  shower->setPrimY(PrimaryPosition[particleType].y());
524  shower->setPrimZ(PrimaryPosition[particleType].z());
525  SLnEvtInBinE(ebin)++;
526  SLnEvtInBinEta(ebin,etabin)++;
527  SLnEvtInBinPhi(ebin,etabin,phibin)++;
528  NHitInEvent+=shower->getNhit();
529  NEvtAccepted++;
530  }
531  else {shower->Clear();}
532  }
533 // Check for unassociated energy
534 
535  if (NEvtAccepted==int(thePrims.size())&&theCAFI->entries()!=NHitInEvent){
536  std::cout << "WARNING: Inconsistent Number of Hits -> Hits in collection: "<< theCAFI->entries()
537  << " Hits in the showers: " << NHitInEvent << std::endl;
538  double miss_energy=0;
539  double tot_energy=0;
540  GetMissingEnergy(theCAFI,miss_energy,tot_energy);
541  if (miss_energy>0) {
542  std::cout << "Total missing energy: " << miss_energy
543  << " for an incident energy: " << tot_energy
544  << std::endl;
545  }
546  }
547 
548 /*
549  for (int i=emSLHolder.SLEnergyBins.size()-1;i>0;i--) {
550  if (emSLHolder.nEvtInBinE.at(i)==(int)emSLHolder.nEvtPerBinE) {
551  std::ostringstream out;
552  out << emSLHolder.SLEnergyBins.at(i);
553  cout << "Bin Limit: " << out.str() << std::endl;
554  setenv("CASTOR_SL_PG_MAXE",out.str().c_str(),1);
555  }
556  break;
557  }
558 */
559  //int iEvt = (*evt)()->GetEventID();
560  //double xint;
561 /*
562  if (modf(log10(iEvt),&xint)==0)
563  std::cout << " CastorShowerLibraryMaker Event " << iEvt << std::endl;
564 */
565  // std::cout << std::endl << "===>>> Done writing user histograms " << std::endl;
566 }
567 
568 //========================= End of RUN ======================
570 {
571 // Fill the tree with the collected objects
572  if (!IsSLReady()) SimG4Exception("\n\nShower Library NOT READY.\n\n");
573 
574  unsigned int ibine,ibineta,ibinphi,ievt; // indexes for em shower
575  unsigned int jbine,jbineta,jbinphi,jevt;// indexes for had shower
576 
577  ibine=ibineta=ibinphi=ievt=jbine=jbineta=jbinphi=jevt=0;
578 
579  int nEvtInTree = 0;
580  int nEMevt = emSLHolder.nEvtPerBinE*emSLHolder.SLEnergyBins.size();
581  int nHadevt = hadSLHolder.nEvtPerBinE*hadSLHolder.SLEnergyBins.size();
582  int maxEvtInTree=std::max(nEMevt,nHadevt);
583 
586 
587  while(nEvtInTree<maxEvtInTree) {
588  if (emShower) emShower->Clear();
589  if (hadShower) hadShower->Clear();
590  while(ibine<emSLHolder.SLEnergyBins.size()&&nEMevt>0){
591  emShower = &(emSLHolder.SLCollection.at(ibine).at(ibineta).at(ibinphi).at(ievt));
592  ievt++;
593  if (ievt==emSLHolder.nEvtPerBinPhi) {ievt=0;ibinphi++;}
594  if (ibinphi==emSLHolder.SLPhiBins.size()) {ibinphi=0;ibineta++;}
595  if (ibineta==emSLHolder.SLEtaBins.size()) {ibineta=0;ibine++;}
596  break;
597  }
598  while(jbine<hadSLHolder.SLEnergyBins.size()&&nHadevt>0){
599  hadShower = &(hadSLHolder.SLCollection.at(jbine).at(jbineta).at(jbinphi).at(jevt));
600  jevt++;
601  if (jevt==hadSLHolder.nEvtPerBinPhi) {jevt=0;jbinphi++;}
602  if (jbinphi==hadSLHolder.SLPhiBins.size()) {jbinphi=0;jbineta++;}
603  if (jbineta==hadSLHolder.SLEtaBins.size()) {jbineta=0;jbine++;}
604  break;
605  }
606  theTree->Fill();
607  nEvtInTree++;
608  if (nEvtInTree==1) {
609  theTree->SetBranchStatus("emShowerLibInfo.",0);
610  theTree->SetBranchStatus("hadShowerLibInfo.",0);
611  }
612  }
613 // check if run is NULL and exit
614  if (run==NULL) throw SimG4Exception("\n\nNumber of needed trigger events reached in CastorShowerLibraryMaker\n\n");
615 }
616 
617 //============================================================
619 
620  // if (doNTcastorevent) {
621 
622  theFile->cd();
623  theTree->Write("",TObject::kOverwrite);
624  std::cout << "CastorShowerLibraryMaker: Ntuple event written" << std::endl;
625  theFile->Close();
626  std::cout << "CastorShowerLibraryMaker: Event file closed" << std::endl;
627 
628  // Delete pointers to objects, now that TTree has been written and TFile closed
629 // delete info;
630 // delete emShower;
631 // delete hadShower;
632  // }
633 }
635  //
636  // returns the integer index of the energy bin, taken from SLenergies vector
637  // returns -1 if ouside valid range
638  //
639  if (!SLShowerptr) {
640  edm::LogInfo("CastorShowerLibraryMaker") << "\n\nFindEnergyBin can be called only after BeginOfEvent\n\n";
641  throw SimG4Exception("\n\nNULL Pointer to the shower library.\n\n");
642  }
643  const std::vector<double>& SLenergies = SLShowerptr->SLEnergyBins;
644  if (energy >= SLenergies.back()) return SLenergies.size()-1;
645 
646  unsigned int i = 0;
647  for(;i<SLenergies.size()-1;i++)
648  if (energy >= SLenergies.at(i) && energy < SLenergies.at(i+1)) return (int)i;
649 
650  // now i points to the last but 1 bin
651  if (energy>=SLenergies.at(i)) return (int)i;
652  // energy outside bin range
653  return -1;
654 }
656  //
657  // returns the integer index of the eta bin, taken from SLetas vector
658  // returns -1 if ouside valid range
659  //
660  if (!SLShowerptr) {
661  edm::LogInfo("CastorShowerLibraryMaker") << "\n\nFindEtaBin can be called only after BeginOfEvent\n\n";
662  throw SimG4Exception("\n\nNULL Pointer to the shower library.\n\n");
663  }
664  const std::vector<double>& SLetas = SLShowerptr->SLEtaBins;
665  if (eta>=SLetas.back()) return SLetas.size()-1;
666  unsigned int i = 0;
667  for(;i<SLetas.size()-1;i++)
668  if (eta >= SLetas.at(i) && eta < SLetas.at(i+1)) return (int)i;
669  // now i points to the last but 1 bin
670  if (eta>=SLetas.at(i)) return (int)i;
671  // eta outside bin range
672  return -1;
673 }
675  //
676  // returns the integer index of the phi bin, taken from SLphis vector
677  // returns -1 if ouside valid range
678  //
679  // needs protection in case phi is outside range -pi,pi
680  //
681  if (!SLShowerptr) {
682  edm::LogInfo("CastorShowerLibraryMaker") << "\n\nFindPhiBin can be called only after BeginOfEvent\n\n";
683  throw SimG4Exception("\n\nNULL Pointer to the shower library.\n\n");
684  }
685  const std::vector<double>& SLphis = SLShowerptr->SLPhiBins;
686  if (phi>=SLphis.back()) return SLphis.size()-1;
687  unsigned int i = 0;
688  for(;i<SLphis.size()-1;i++)
689  if (phi >= SLphis.at(i) && phi < SLphis.at(i+1)) return (int)i;
690  // now i points to the last but 1 bin
691  if (phi>=SLphis.at(i)) return (int)i;
692  // phi outside bin range
693  return -1;
694 }
696 {
697 // at this point, the pointer to the shower library should be NULL
698  if (SLShowerptr) {
699  edm::LogInfo("CastorShowerLibraryMaker") << "\n\nIsSLReady must be called when a new event starts.\n\n";
700  throw SimG4Exception("\n\nNOT NULL Pointer to the shower library.\n\n");
701  }
702 // it is enough to check if all the energy bin is filled
703  if (DoEmSL) {
705  for(unsigned int i=0;i<SLShowerptr->SLEnergyBins.size();i++) {
706  if (!SLisEBinFilled(i)) {
708  return false;
709  }
710  }
711  }
712  if (DoHadSL) {
714  for(unsigned int i=0;i<SLShowerptr->SLEnergyBins.size();i++) {
715  if (!SLisEBinFilled(i)) {
717  return false;
718  }
719  }
720  }
722  return true;
723 }
724 void CastorShowerLibraryMaker::GetKinematics(int thePrim,double& px, double& py, double& pz, double& pInit, double& eta, double& phi)
725 {
726  if (thePrim==0) return;
727  if (PrimaryMomentum.find(thePrim)==PrimaryMomentum.end()) return;
728  px = PrimaryMomentum[thePrim].x()/GeV;
729  py = PrimaryMomentum[thePrim].y()/GeV;
730  pz = PrimaryMomentum[thePrim].z()/GeV;
731  pInit=PrimaryMomentum[thePrim].mag()/GeV;
732  if (pInit==0) return;
733  double costheta = pz/pInit;
734  double theta = acos(std::min(std::max(costheta,double(-1.)),double(1.)));
735  eta = -log(tan(theta/2.0));
736  phi = (px==0 && py==0) ? 0 : atan2(py,px); // the recommended way of calculating phi
737  phi = PrimaryMomentum[thePrim].phi();
738 }
739 void CastorShowerLibraryMaker::GetKinematics(G4PrimaryParticle* thePrim,double& px, double& py, double& pz, double& pInit, double& eta, double& phi)
740 {
741  px=py=pz=phi=eta=0.0;
742  if (thePrim==0) return;
743  px = thePrim->GetMomentum().x()/GeV;
744  py = thePrim->GetMomentum().y()/GeV;
745  pz = thePrim->GetMomentum().z()/GeV;
746  pInit = thePrim->GetMomentum().mag()/GeV;
747  //pInit = sqrt(pow(px,2.)+pow(py,2.)+pow(pz,2.));
748  if (pInit==0) return;
749  double costheta = pz/pInit;
750  double theta = acos(std::min(std::max(costheta,double(-1.)),double(1.)));
751  eta = -log(tan(theta/2.0));
752  phi = (px==0 && py==0) ? 0 : atan2(py,px); // the recommended way of calculating phi
753  phi = thePrim->GetMomentum().phi();
754  //if (px!=0) phi=atan(py/px);
755 }
756 std::vector<G4PrimaryParticle*> CastorShowerLibraryMaker::GetPrimary(const G4Event * evt)
757 {
758  // Find Primary info:
759  int trackID = 0;
760  std::vector<G4PrimaryParticle*> thePrims;
761  G4PrimaryParticle* thePrim = 0;
762  G4int nvertex = evt->GetNumberOfPrimaryVertex();
763  edm::LogInfo("CastorShowerLibraryMaker") << "Event has " << nvertex << " vertex";
764  if (nvertex!=1) {
765  edm::LogInfo("CastorShowerLibraryMaker") << "CastorShowerLibraryMaker::GetPrimary ERROR: no vertex";
766  return thePrims;
767  }
768 
769  for (int i = 0 ; i<nvertex; i++) {
770  G4PrimaryVertex* avertex = evt->GetPrimaryVertex(i);
771  if (avertex == 0) {
772  edm::LogInfo("CastorShowerLibraryMaker")
773  << "CastorShowerLibraryMaker::GetPrimary ERROR: pointer to vertex = 0";
774  continue;
775  }
776  unsigned int npart = avertex->GetNumberOfParticle();
777  if (npart!=NPGParticle) continue;
778  for (unsigned int j=0;j<npart;j++) {
779  unsigned int k = 0;
780  //int test_pID = 0;
781  trackID = j;
782  thePrim=avertex->GetPrimary(trackID);
783  while(k<NPGParticle&&PGParticleIDs.at(k++)!=thePrim->GetPDGcode()){;};
784  if (k>NPGParticle) continue; // ID not found in the requested particles
785  thePrims.push_back(thePrim);
786  }
787  }
788  return thePrims;
789 }
791 {
792  if (!SLShowerptr) {
793  edm::LogInfo("CastorShowerLibraryInfo") << "NULL shower pointer. Printing both";
794  std::cout << "Electromagnetic" << std::endl;
796  this->printSLstatus(ebin,etabin,phibin);
797  std::cout << "Hadronic" << std::endl;
799  this->printSLstatus(ebin,etabin,phibin);
800  SLShowerptr = NULL;
801  return;
802  }
803  int nBinsE =SLShowerptr->SLEnergyBins.size();
804  int nBinsEta=SLShowerptr->SLEtaBins.size();
805  int nBinsPhi=SLShowerptr->SLPhiBins.size();
806  std::vector<double> SLenergies = SLShowerptr->SLEnergyBins;
807  for(int n=0;n<11+(nBinsEta*nBinsPhi);n++) std::cout << "=";
808  std::cout << std::endl;
809  for(int i=0;i<nBinsE;i++) {
810  std::cout << "E bin " << std::setw(6) << SLenergies.at(i) << " : ";
811  for(int j=0;j<nBinsEta;j++) {
812  for(int k=0;k<nBinsPhi;k++) {
813  (SLisPhiBinFilled(i,j,k))?std::cout << "1":std::cout << "-";
814  }
815  if (j<nBinsEta-1) std::cout << "|";
816  }
817  std::cout << " (" << SLnEvtInBinE(i) << " events)";
818  std::cout << std::endl;
819  if (ebin!=i) continue;
820  std::cout << " ";
821  for(int j=0;j<nBinsEta;j++) {
822  for(int k=0;k<nBinsPhi;k++) {
823  (ebin==i&&etabin==j&&phibin==k)?std::cout << "^":std::cout << " ";
824  }
825  if (j<nBinsEta-1) std::cout << " ";
826  }
827  std::cout << std::endl;
828  }
829  for(int n=0;n<11+(nBinsEta*nBinsPhi);n++) std::cout << "=";
830  std::cout << std::endl;
831 }
833 {
834  if (SLShowerptr==NULL) {
835  edm::LogInfo("CastorShowerLibraryMaker::SLacceptEvent:") << "Error. NULL pointer to CastorShowerEvent";
836  return false;
837  }
838  if (ebin<0||ebin>=int(SLShowerptr->SLEnergyBins.size())) return false;
839  if (SLisEBinFilled(ebin)) return false;
840 
841  if (etabin<0||etabin>=int(SLShowerptr->SLEtaBins.size())) return false;
842  if (SLisEtaBinFilled(ebin,etabin)) return false;
843 
844  if (phibin<0||phibin>=int(SLShowerptr->SLPhiBins.size())) return false;
845  if (SLisPhiBinFilled(ebin,etabin,phibin)) return false;
846  return true;
847 }
849 {
850  unsigned int volumeID=0;
851  double en_in_fi = 0.;
852  //double totalEnergy = 0;
853 
854  int nentries = theCAFI->entries();
855 
856 // Compute Total Energy in CastorFI volume
857 /*
858  for(int ihit = 0; ihit < nentries; ihit++) {
859  CaloG4Hit* aHit = (*theCAFI)[ihit];
860  totalEnergy += aHit->getEnergyDeposit();
861  }
862 */
863  if (!shower) {
864  edm::LogInfo("CastorShowerLibraryMaker") << "Error. NULL pointer to CastorShowerEvent";
865  return false;
866  }
867 
868  CastorNumberingScheme *theCastorNumScheme = new CastorNumberingScheme();
869 // Hit position
872  int nHits;
873  nHits=0;
874  for (int ihit = 0; ihit < nentries; ihit++) {
875  CaloG4Hit* aHit = (*theCAFI)[ihit];
876  int hit_particleID = aHit->getTrackID();
877  if (MapOfSecondaries[ipart].find(hit_particleID)==MapOfSecondaries[ipart].end()) {
878  if (verbosity) edm::LogInfo("CastorShowerLibraryMaker")
879  << "Skipping hit from trackID " << hit_particleID;
880  continue;
881  }
882  volumeID = aHit->getUnitID();
883  double hitEnergy = aHit->getEnergyDeposit();
884  en_in_fi += aHit->getEnergyDeposit();
885  float time = aHit->getTimeSlice();
886  int zside, sector, zmodule;
887  theCastorNumScheme->unpackIndex(volumeID, zside, sector,zmodule);
888  entry = aHit->getEntry();
889  position = aHit->getPosition();
890  if (verbosity) edm::LogInfo("CastorShowerLibraryMaker")
891  << "\n side , sector , module = " << zside << " , "
892  << sector << " , " << zmodule
893  << "\n nphotons = " << hitEnergy ;
894 
895  if (verbosity) edm::LogInfo("CastorShowerLibraryMaker")
896  << "\n packIndex = "
897  << theCastorNumScheme->packIndex(zside, sector,zmodule);
898 
899  if(verbosity&&time>100.) {
900  edm::LogInfo("CastorShowerLibraryMaker")
901  << "\n nentries = " << nentries
902  << "\n time[" << ihit << "] = " << time
903  << "\n trackID[" << ihit << "] = " << aHit->getTrackID()
904  << "\n volumeID[" << ihit << "] = " << volumeID
905  << "\n nphotons[" << ihit << "] = " << hitEnergy
906  << "\n side, sector, module = " << zside <<", " << sector<<", " << zmodule
907  << "\n packIndex " << theCastorNumScheme->packIndex(zside,sector,zmodule)
908  << "\n X,Y,Z = " << entry.x() << ","<< entry.y() << "," << entry.z();
909  }
910  if (verbosity) edm::LogInfo("CastorShowerLibraryMaker") << "\n Incident Energy = "
911  << aHit->getIncidentEnergy() << " \n" ;
912 
913 // CaloG4Hit information
914  shower->setDetID(volumeID);
915  shower->setHitPosition(position);
916  shower->setNphotons(hitEnergy);
917  shower->setTime(time);
918  nHits++;
919  }
920 // Write number of hits to CastorShowerEvent instance
921  if (nHits==0) {
922  edm::LogInfo("CastorShowerLibraryMaker") << "No hits found for this track (trackID=" << ipart << ")." << std::endl;
923  if (theCastorNumScheme) delete theCastorNumScheme;
924  return false;
925  }
926  shower->setNhit(nHits);
927 
928 // update the event counters
929  if (theCastorNumScheme) delete theCastorNumScheme;
930  return true;
931 }
933 {
934  if (!SLShowerptr) {
935  edm::LogInfo("CastorShowerLibraryMaker") << "\n\nSLnEvtInBinE can be called only after BeginOfEvent\n\n";
936  throw SimG4Exception("\n\nNULL Pointer to the shower library.");
937  }
938  return SLShowerptr->nEvtInBinE.at(ebin);
939 }
940 
942 {
943  if (!SLShowerptr) {
944  edm::LogInfo("CastorShowerLibraryMaker") << "\n\nSLnEvtInBinEta can be called only after BeginOfEvent\n\n";
945  throw SimG4Exception("\n\nNULL Pointer to the shower library.");
946  }
947  return SLShowerptr->nEvtInBinEta.at(ebin).at(etabin);
948 }
949 
951 {
952  if (!SLShowerptr) {
953  edm::LogInfo("CastorShowerLibraryMaker") << "\n\nSLnEvtInBinPhi can be called only after BeginOfEvent\n\n";
954  throw SimG4Exception("\n\nNULL Pointer to the shower library.");
955  }
956  return SLShowerptr->nEvtInBinPhi.at(ebin).at(etabin).at(phibin);
957 }
959 {
960  if (!SLShowerptr) {
961  edm::LogInfo("CastorShowerLibraryMaker") << "\n\nSLisEBinFilled can be called only after BeginOfEvent\n\n";
962  throw SimG4Exception("\n\nNULL Pointer to the shower library.");
963  }
964  if (SLShowerptr->nEvtInBinE.at(ebin)<(int)SLShowerptr->nEvtPerBinE) return false;
965  return true;
966 }
968 {
969  if (!SLShowerptr) {
970  edm::LogInfo("CastorShowerLibraryMaker") << "\n\nSLisEtaBinFilled can be called only after BeginOfEvent\n\n";
971  throw SimG4Exception("\n\nNULL Pointer to the shower library.");
972  }
973  if (SLShowerptr->nEvtInBinEta.at(ebin).at(etabin)<(int)SLShowerptr->nEvtPerBinEta) return false;
974  return true;
975 }
977 {
978  if (!SLShowerptr) {
979  edm::LogInfo("CastorShowerLibraryMaker") << "\n\nSLisPhiBinFilled can be called only after BeginOfEvent\n\n";
980  throw SimG4Exception("\n\nNULL Pointer to the shower library.");
981  }
982  if (SLShowerptr->nEvtInBinPhi.at(ebin).at(etabin).at(phibin)<(int)SLShowerptr->nEvtPerBinPhi) return false;
983  return true;
984 }
985 void CastorShowerLibraryMaker::KillSecondaries(const G4Step * aStep) {
986  G4TrackVector *p_sec = const_cast<G4TrackVector*>(aStep->GetSecondary());
987  for(int i=0;i<int(p_sec->size());i++) {
988  /*if (verbosity)*/ std::cout << "Killing track ID " << p_sec->at(i)->GetTrackID() << " and its secondaries"
989  << " Produced by Process " << p_sec->at(i)->GetCreatorProcess()->GetProcessName()
990  << " in the volume " << aStep->GetTrack()->GetVolume()->GetName()
991  << std::endl;
992  p_sec->at(i)->SetTrackStatus(fKillTrackAndSecondaries);
993  }
994 }
995 
996 void CastorShowerLibraryMaker::GetMissingEnergy(CaloG4HitCollection* theCAFI,double& miss_energy,double& tot_energy){
997 // Get the total deposited energy and the one from hit not associated to a primary
998  miss_energy = 0;
999  tot_energy = 0;
1000  for (int ihit = 0; ihit < theCAFI->entries(); ihit++) {
1001  int id = (*theCAFI)[ihit]->getTrackID();
1002  tot_energy+=(*theCAFI)[ihit]->getEnergyDeposit();
1003  int hit_prim = 0;
1004  for(unsigned int i=0;i<thePrims.size();i++) {
1005  int particleType = thePrims.at(i)->GetPDGcode();
1006  if (MapOfSecondaries[particleType].find(id)!=MapOfSecondaries[particleType].end())
1007  hit_prim = particleType;
1008  }
1009  if (hit_prim==0) {
1010  std::cout << "Track ID " << id << " produced a hit which is not associated with a primary."
1011  << std::endl;
1012  miss_energy+=(*theCAFI)[ihit]->getEnergyDeposit();
1013  }
1014  }
1015 }
T getParameter(std::string const &) const
void setNBins(unsigned int n)
int i
Definition: DBlmapReader.cc:9
math::XYZPoint getPosition() const
Definition: CaloG4Hit.h:56
void setTime(float t)
void setPrimEta(float eta)
void setPrimZ(float z)
void setDetID(unsigned int id)
int & SLnEvtInBinEta(int ebin, int etabin)
TrainProcessor *const proc
Definition: MVATrainer.cc:101
void setPrimPhi(float phi)
void setBin(double val)
std::vector< G4PrimaryParticle * > thePrims
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
bool FillShowerEvent(CaloG4HitCollection *, CastorShowerEvent *, int)
double getIncidentEnergy() const
Definition: CaloG4Hit.h:65
#define abs(x)
Definition: mlp_lapack.h:159
void KillSecondaries(const G4Step *step)
#define NULL
Definition: scimark2.h:8
double npart
Definition: HydjetWrapper.h:45
#define min(a, b)
Definition: mlp_lapack.h:161
T eta() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:22
bool SLisEtaBinFilled(int ebin, int etabin)
static void unpackIndex(const uint32_t &idx, int &z, int &sector, int &zmodule)
double double double z
void setNEvtPerBin(unsigned int n)
std::vector< G4PrimaryParticle * > GetPrimary(const G4Event *)
CastorShowerLibraryInfo * hadInfo
const T & max(const T &a, const T &b)
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
std::map< int, G4ThreeVector > PrimaryMomentum
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::map< int, G4ThreeVector > PrimaryPosition
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
int j
Definition: DBlmapReader.cc:9
std::vector< std::vector< std::vector< int > > > nEvtInBinPhi
#define end
Definition: vmac.h:38
std::map< int, std::set< int > > MapOfSecondaries
CastorShowerLibraryInfo * emInfo
CastorShowerLibraryMaker(const edm::ParameterSet &p)
int k[5][pyjets_maxn]
void setPrimE(float e)
void setPrimY(float y)
void GetMissingEnergy(CaloG4HitCollection *, double &, double &)
void GetKinematics(G4PrimaryParticle *, double &px, double &py, double &pz, double &pInit, double &eta, double &phi)
int getTrackID() const
Definition: CaloG4Hit.h:68
void setPrimX(float x)
int & SLnEvtInBinPhi(int ebin, int etabin, int phibin)
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
std::vector< std::vector< int > > nEvtInBinEta
void setHitPosition(Point p)
void setNEvts(unsigned int n)
void update(const BeginOfJob *run)
This routine will be called when the appropriate signal arrives.
G4THitsCollection< CaloG4Hit > CaloG4HitCollection
static int position[264][3]
Definition: ReadPGInfo.cc:509
bool SLisPhiBinFilled(int ebin, int etabin, int phibin)
tuple job
Definition: launcher.py:57
double getTimeSlice() const
Definition: CaloG4Hit.h:70
tuple cout
Definition: gather_cfg.py:121
math::XYZPoint getEntry() const
Definition: CaloG4Hit.h:50
uint32_t getUnitID() const
Definition: CaloG4Hit.h:69
static uint32_t packIndex(int z, int sector, int zmodule)
x
Definition: VDTMath.h:216
void setNphotons(float np)
double split
Definition: MVATrainer.cc:139
void setNhit(unsigned int i)
unsigned int getNhit()
double getEnergyDeposit() const
Definition: CaloG4Hit.h:81
Definition: DDAxes.h:10