CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
HCalSD Class Reference

#include <HCalSD.h>

Inheritance diagram for HCalSD:
CaloSD Observer< const BeginOfJob * > SensitiveCaloDetector Observer< const BeginOfRun * > Observer< const BeginOfEvent * > Observer< const BeginOfTrack * > Observer< const EndOfTrack * > Observer< const EndOfEvent * > SensitiveDetector

Public Member Functions

virtual double getEnergyDeposit (G4Step *)
 
 HCalSD (G4String, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
 
virtual bool ProcessHits (G4Step *, G4TouchableHistory *)
 
virtual uint32_t setDetUnitId (G4Step *step)
 
void setNumberingScheme (HcalNumberingScheme *)
 
virtual ~HCalSD ()
 
- Public Member Functions inherited from CaloSD
 CaloSD (G4String aSDname, const DDCompactView &cpv, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *, float timeSlice=1., bool ignoreTkID=false)
 
virtual void clear ()
 
virtual void DrawAll ()
 
virtual void EndOfEvent (G4HCofThisEvent *eventHC)
 
void fillHits (edm::PCaloHitContainer &, std::string n)
 
virtual void Initialize (G4HCofThisEvent *HCE)
 
virtual void PrintAll ()
 
virtual bool ProcessHits (G4GFlashSpot *aSpot, G4TouchableHistory *)
 
virtual ~CaloSD ()
 
- Public Member Functions inherited from SensitiveCaloDetector
 SensitiveCaloDetector (std::string &iname, const DDCompactView &cpv, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p)
 
- Public Member Functions inherited from SensitiveDetector
virtual void AssignSD (const std::string &vname)
 
Local3DPoint ConvertToLocal3DPoint (const G4ThreeVector &point)
 
Local3DPoint FinalStepPosition (G4Step *s, coordinates)
 
virtual std::vector< std::string > getNames ()
 
Local3DPoint InitialStepPosition (G4Step *s, coordinates)
 
std::string nameOfSD ()
 
void NaNTrap (G4Step *step)
 
void Register ()
 
 SensitiveDetector (std::string &iname, const DDCompactView &cpv, const SensitiveDetectorCatalog &, edm::ParameterSet const &p)
 
virtual ~SensitiveDetector ()
 
- Public Member Functions inherited from Observer< const BeginOfRun * >
 Observer ()
 
void slotForUpdate (const BeginOfRun *iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const BeginOfEvent * >
 Observer ()
 
void slotForUpdate (const BeginOfEvent *iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const BeginOfTrack * >
 Observer ()
 
void slotForUpdate (const BeginOfTrack *iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const EndOfTrack * >
 Observer ()
 
void slotForUpdate (const EndOfTrack *iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const EndOfEvent * >
 Observer ()
 
void slotForUpdate (const EndOfEvent *iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const BeginOfJob * >
 Observer ()
 
void slotForUpdate (const BeginOfJob *iT)
 
virtual ~Observer ()
 

Protected Member Functions

virtual bool filterHit (CaloG4Hit *, double)
 
virtual void initRun ()
 
virtual void update (const BeginOfJob *)
 This routine will be called when the appropriate signal arrives. More...
 
- Protected Member Functions inherited from CaloSD
G4bool checkHit ()
 
virtual void clearHits ()
 
CaloG4HitcreateNewHit ()
 
double getAttenuation (G4Step *aStep, double birk1, double birk2, double birk3)
 
virtual uint16_t getDepth (G4Step *)
 
int getNumberOfHits ()
 
double getResponseWt (G4Track *)
 
virtual G4bool getStepInfo (G4Step *aStep)
 
virtual int getTrackID (G4Track *)
 
G4bool hitExists ()
 
void resetForNewPrimary (const G4ThreeVector &, double)
 
G4ThreeVector setToGlobal (const G4ThreeVector &, const G4VTouchable *)
 
G4ThreeVector setToLocal (const G4ThreeVector &, const G4VTouchable *)
 
virtual void update (const BeginOfRun *)
 This routine will be called when the appropriate signal arrives. More...
 
virtual void update (const BeginOfEvent *)
 This routine will be called when the appropriate signal arrives. More...
 
virtual void update (const BeginOfTrack *trk)
 This routine will be called when the appropriate signal arrives. More...
 
virtual void update (const EndOfTrack *trk)
 This routine will be called when the appropriate signal arrives. More...
 
virtual void update (const ::EndOfEvent *)
 
void updateHit (CaloG4Hit *)
 
- Protected Member Functions inherited from Observer< const EndOfEvent * >
virtual void update (const EndOfEvent *)=0
 This routine will be called when the appropriate signal arrives. More...
 

Private Member Functions

std::vector< double > getDDDArray (const std::string &, const DDsvalues_type &)
 
void getFromLibrary (G4Step *step, double weight)
 
void getFromParam (G4Step *step, double weight)
 
void getHitFibreBundle (G4Step *step, bool type)
 
void getHitPMT (G4Step *step)
 
std::vector< G4String > getNames (DDFilteredView &)
 
void hitForFibre (G4Step *step, double weight)
 
bool isItConicalBundle (G4LogicalVolume *)
 
bool isItFibre (G4LogicalVolume *)
 
bool isItFibre (G4String)
 
bool isItHF (G4Step *)
 
bool isItHF (G4String)
 
bool isItinFidVolume (G4ThreeVector &)
 
bool isItPMT (G4LogicalVolume *)
 
bool isItScintillator (G4Material *)
 
bool isItStraightBundle (G4LogicalVolume *)
 
double layerWeight (int, const G4ThreeVector &, int, int)
 
void modifyDepth (HcalNumberingFromDDD::HcalID &id)
 
void plotHF (G4ThreeVector &pos, bool emType)
 
void plotProfile (G4Step *step, const G4ThreeVector &pos, double edep, double time, int id)
 
void readWeightFromFile (std::string)
 
uint32_t setDetUnitId (int, const G4ThreeVector &, int, int)
 
int setTrackID (G4Step *step)
 

Private Attributes

bool applyFidCut
 
double betaThr
 
double birk1
 
double birk2
 
double birk3
 
double deliveredLumi
 
TH1F * dist_ [9]
 
double eminHitHB
 
double eminHitHE
 
double eminHitHF
 
double eminHitHO
 
std::vector< G4LogicalVolume * > fibre1LV
 
std::vector< G4LogicalVolume * > fibre2LV
 
std::vector< G4LogicalVolume * > fibreLV
 
std::vector< G4String > fibreNames
 
std::vector< double > gpar
 
HcalDDDSimConstantshcalConstants
 
std::vector< int > hfLevels
 
std::vector< G4LogicalVolume * > hfLV
 
std::vector< G4String > hfNames
 
HFShowerhfshower
 
TH1F * hit_ [9]
 
TH1F * hzvem
 
TH1F * hzvhad
 
std::vector< double > layer0wt
 
std::map< uint32_t, double > layerWeights
 
HEDarkeningm_HEDarkening
 
HFDarkeningm_HFDarkening
 
std::vector< G4Material * > materials
 
std::vector< G4String > matNames
 
G4int mumPDG
 
G4int mupPDG
 
HcalNumberingFromDDDnumberingFromDDD
 
HcalNumberingSchemenumberingScheme
 
std::vector< G4LogicalVolume * > pmtLV
 
HFShowerFibreBundleshowerBundle
 
HFShowerLibraryshowerLibrary
 
HFShowerParamshowerParam
 
HFShowerPMTshowerPMT
 
bool testNumber
 
TH1F * time_ [9]
 
bool useBirk
 
bool useFibreBundle
 
bool useHF
 
bool useLayerWt
 
bool useParam
 
bool usePMTHit
 
bool useShowerLibrary
 

Additional Inherited Members

- Public Types inherited from SensitiveDetector
enum  coordinates { WorldCoordinates, LocalCoordinates }
 
- Protected Attributes inherited from CaloSD
int checkHits
 
double correctT
 
bool corrTOFBeam
 
CaloG4HitcurrentHit
 
CaloHitID currentID
 
float edepositEM
 
float edepositHAD
 
double eminHit
 
double eminHitD
 
G4int emPDG
 
double energyCut
 
G4ThreeVector entranceLocal
 
G4ThreeVector entrancePoint
 
G4int epPDG
 
bool forceSave
 
G4int gammaPDG
 
float incidentEnergy
 
double kmaxIon
 
double kmaxNeutron
 
double kmaxProton
 
const SimTrackManagerm_trackManager
 
G4ThreeVector posGlobal
 
G4StepPoint * preStepPoint
 
CaloHitID previousID
 
int primIDSaved
 
bool runInit
 
bool suppressHeavy
 
G4Track * theTrack
 
double tmaxHit
 
bool useMap
 

Detailed Description

Definition at line 35 of file HCalSD.h.

Constructor & Destructor Documentation

HCalSD::HCalSD ( G4String  name,
const DDCompactView cpv,
const SensitiveDetectorCatalog clg,
edm::ParameterSet const &  p,
const SimTrackManager manager 
)

Definition at line 42 of file HCalSD.cc.

References DDFilteredView::addFilter(), AND, applyFidCut, betaThr, birk1, birk2, birk3, deliveredLumi, dist_, eminHitHB, eminHitHE, eminHitHF, eminHitHO, equals, fibre1LV, fibre2LV, fibreLV, fibreNames, mergeVDriftHistosByStation::file, DDFilteredView::firstChild(), g, getDDDArray(), SensitiveDetector::getNames(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), hfLevels, hfLV, hfNames, hfshower, hit_, hzvem, hzvhad, i, edm::Service< T >::isAvailable(), isItFibre(), isItHF(), CaloSD::kmaxIon, CaloSD::kmaxNeutron, CaloSD::kmaxProton, HLT_25ns10e33_v2_cff::labels, testEve_cfg::level, dqm-mbProfile::log, LogDebug, DDFilteredView::logicalPart(), m_HEDarkening, m_HFDarkening, TFileDirectory::make(), DDLogicalPart::material(), materials, matNames, DDFilteredView::mergedSpecifics(), MeV, TFileService::mkdir(), mumPDG, mupPDG, DDName::name(), SensitiveDetector::name, DDBase< N, C >::name(), DDFilteredView::next(), not_equals, pmtLV, readWeightFromFile(), DDSpecificsFilter::setCriteria(), setNumberingScheme(), showerBundle, showerLibrary, showerParam, showerPMT, AlCaHLTBitMon_QueryRunRegistry::string, CaloSD::suppressHeavy, groupFilesInBlocks::temp, testNumber, time_, indexGen::title, useBirk, useFibreBundle, useHF, useLayerWt, useParam, usePMTHit, useShowerLibrary, and relativeConstraints::value.

44  :
45  CaloSD(name, cpv, clg, p, manager,
46  (float)(p.getParameter<edm::ParameterSet>("HCalSD").getParameter<double>("TimeSliceUnit")),
47  p.getParameter<edm::ParameterSet>("HCalSD").getParameter<bool>("IgnoreTrackID")),
50  m_HFDarkening(0) {
51 
52  //static SimpleConfigurable<bool> on1(false, "HCalSD:UseBirkLaw");
53  //static SimpleConfigurable<double> bk1(0.013, "HCalSD:BirkC1");
54  //static SimpleConfigurable<double> bk2(0.0568,"HCalSD:BirkC2");
55  //static SimpleConfigurable<double> bk3(1.75, "HCalSD:BirkC3");
56  // Values from NIM 80 (1970) 239-244: as implemented in Geant3
57  //static SimpleConfigurable<bool> on2(true,"HCalSD:UseShowerLibrary");
58  edm::ParameterSet m_HC = p.getParameter<edm::ParameterSet>("HCalSD");
59  useBirk = m_HC.getParameter<bool>("UseBirkLaw");
60  birk1 = m_HC.getParameter<double>("BirkC1")*(g/(MeV*cm2));
61  birk2 = m_HC.getParameter<double>("BirkC2");
62  birk3 = m_HC.getParameter<double>("BirkC3");
63  useShowerLibrary = m_HC.getParameter<bool>("UseShowerLibrary");
64  useParam = m_HC.getParameter<bool>("UseParametrize");
65  testNumber = m_HC.getParameter<bool>("TestNumberingScheme");
66  usePMTHit = m_HC.getParameter<bool>("UsePMTHits");
67  betaThr = m_HC.getParameter<double>("BetaThreshold");
68  eminHitHB = m_HC.getParameter<double>("EminHitHB")*MeV;
69  eminHitHE = m_HC.getParameter<double>("EminHitHE")*MeV;
70  eminHitHO = m_HC.getParameter<double>("EminHitHO")*MeV;
71  eminHitHF = m_HC.getParameter<double>("EminHitHF")*MeV;
72  useFibreBundle = m_HC.getParameter<bool>("UseFibreBundleHits");
73  deliveredLumi = m_HC.getParameter<double>("DelivLuminosity");
74  bool ageingFlagHE= m_HC.getParameter<bool>("HEDarkening");
75  bool ageingFlagHF= m_HC.getParameter<bool>("HFDarkening");
76  useHF = m_HC.getUntrackedParameter<bool>("UseHF",true);
77  bool forTBH2 = m_HC.getUntrackedParameter<bool>("ForTBH2",false);
78  useLayerWt = m_HC.getUntrackedParameter<bool>("UseLayerWt",false);
79  std::string file = m_HC.getUntrackedParameter<std::string>("WtFile","None");
80  edm::ParameterSet m_HF = p.getParameter<edm::ParameterSet>("HFShower");
81  applyFidCut = m_HF.getParameter<bool>("ApplyFiducialCut");
82 
83 #ifdef DebugLog
84  LogDebug("HcalSim") << "***************************************************"
85  << "\n"
86  << "* *"
87  << "\n"
88  << "* Constructing a HCalSD with name " << name << "\n"
89  << "* *"
90  << "\n"
91  << "***************************************************";
92 #endif
93  edm::LogInfo("HcalSim") << "HCalSD:: Use of HF code is set to " << useHF
94  << "\nUse of shower parametrization set to "
95  << useParam << "\nUse of shower library is set to "
96  << useShowerLibrary << "\nUse PMT Hit is set to "
97  << usePMTHit << " with beta Threshold "<< betaThr
98  << "\nUSe of FibreBundle Hit set to "<<useFibreBundle
99  << "\n Use of Birks law is set to "
100  << useBirk << " with three constants kB = "
101  << birk1 << ", C1 = " << birk2 << ", C2 = " << birk3;
102  edm::LogInfo("HcalSim") << "HCalSD:: Suppression Flag " << suppressHeavy
103  << " protons below " << kmaxProton << " MeV,"
104  << " neutrons below " << kmaxNeutron << " MeV and"
105  << " ions below " << kmaxIon << " MeV\n"
106  << " Threshold for storing hits in HB: "
107  << eminHitHB << " HE: " << eminHitHE << " HO: "
108  << eminHitHO << " HF: " << eminHitHF << "\n"
109  << "Delivered luminosity for Darkening "
110  << deliveredLumi << " Flag (HE) " << ageingFlagHE
111  << " Flag (HF) " << ageingFlagHF << "\n"
112  << "Application of Fiducial Cut " << applyFidCut;
113 
114  HcalNumberingScheme* scheme;
115  if (testNumber || forTBH2)
116  scheme = dynamic_cast<HcalNumberingScheme*>(new HcalTestNumberingScheme(forTBH2));
117  else
118  scheme = new HcalNumberingScheme();
119  setNumberingScheme(scheme);
120 
121  const G4LogicalVolumeStore * lvs = G4LogicalVolumeStore::GetInstance();
122  std::vector<G4LogicalVolume *>::const_iterator lvcite;
123  G4LogicalVolume* lv;
124  std::string attribute, value;
125  if (useHF) {
126  if (useParam) {
127  showerParam = new HFShowerParam(name, cpv, p);
128  } else {
129  if (useShowerLibrary) showerLibrary = new HFShowerLibrary(name, cpv, p);
130  hfshower = new HFShower(name, cpv, p, 0);
131  }
132 
133  // HF volume names
134  attribute = "Volume";
135  value = "HF";
136  DDSpecificsFilter filter0;
137  DDValue ddv0(attribute, value, 0);
138  filter0.setCriteria(ddv0, DDCompOp::equals);
139  DDFilteredView fv0(cpv);
140  fv0.addFilter(filter0);
141  hfNames = getNames(fv0);
142  fv0.firstChild();
143  DDsvalues_type sv0(fv0.mergedSpecifics());
144  std::vector<double> temp = getDDDArray("Levels",sv0);
145  edm::LogInfo("HcalSim") << "HCalSD: Names to be tested for " << attribute
146  << " = " << value << " has " << hfNames.size()
147  << " elements";
148  for (unsigned int i=0; i < hfNames.size(); ++i) {
149  G4String namv = hfNames[i];
150  lv = 0;
151  for(lvcite=lvs->begin(); lvcite!=lvs->end(); lvcite++)
152  if((*lvcite)->GetName()==namv) {
153  lv = (*lvcite);
154  break;
155  }
156  hfLV.push_back(lv);
157  int level = static_cast<int>(temp[i]);
158  hfLevels.push_back(level);
159  edm::LogInfo("HcalSim") << "HCalSD: HF[" << i << "] = " << hfNames[i]
160  << " LV " << hfLV[i] << " at level "
161  << hfLevels[i];
162  }
163 
164  // HF Fibre volume names
165  value = "HFFibre";
166  DDSpecificsFilter filter1;
167  DDValue ddv1(attribute,value,0);
168  filter1.setCriteria(ddv1, DDCompOp::equals);
169  DDFilteredView fv1(cpv);
170  fv1.addFilter(filter1);
171  fibreNames = getNames(fv1);
172  edm::LogInfo("HcalSim") << "HCalSD: Names to be tested for " << attribute
173  << " = " << value << ":";
174  for (unsigned int i=0; i<fibreNames.size(); ++i) {
175  G4String namv = fibreNames[i];
176  lv = 0;
177  for (lvcite = lvs->begin(); lvcite != lvs->end(); ++lvcite) {
178  if ((*lvcite)->GetName() == namv) {
179  lv = (*lvcite);
180  break;
181  }
182  }
183  fibreLV.push_back(lv);
184  edm::LogInfo("HcalSim") << "HCalSD: (" << i << ") " << fibreNames[i]
185  << " LV " << fibreLV[i];
186  }
187 
188  // HF PMT volume names
189  value = "HFPMT";
190  DDSpecificsFilter filter3;
191  DDValue ddv3(attribute,value,0);
192  filter3.setCriteria(ddv3,DDCompOp::equals);
193  DDFilteredView fv3(cpv);
194  fv3.addFilter(filter3);
195  std::vector<G4String> pmtNames = getNames(fv3);
196  edm::LogInfo("HcalSim") << "HCalSD: Names to be tested for " << attribute
197  << " = " << value << " have " << pmtNames.size()
198  << " entries";
199  for (unsigned int i=0; i<pmtNames.size(); ++i) {
200  G4String namv = pmtNames[i];
201  lv = 0;
202  for (lvcite = lvs->begin(); lvcite != lvs->end(); ++lvcite)
203  if ((*lvcite)->GetName() == namv) {
204  lv = (*lvcite);
205  break;
206  }
207  pmtLV.push_back(lv);
208  edm::LogInfo("HcalSim") << "HCalSD: (" << i << ") " << pmtNames[i]
209  << " LV " << pmtLV[i];
210  }
211  if (pmtNames.size() > 0) showerPMT = new HFShowerPMT (name, cpv, p);
212 
213  // HF Fibre bundles
214  value = "HFFibreBundleStraight";
215  DDSpecificsFilter filter4;
216  DDValue ddv4(attribute,value,0);
217  filter4.setCriteria(ddv4,DDCompOp::equals);
218  DDFilteredView fv4(cpv);
219  fv4.addFilter(filter4);
220  std::vector<G4String> fibreNames = getNames(fv4);
221  edm::LogInfo("HcalSim") << "HCalSD: Names to be tested for " << attribute
222  << " = " << value << " have " << fibreNames.size()
223  << " entries";
224  for (unsigned int i=0; i<fibreNames.size(); ++i) {
225  G4String namv = fibreNames[i];
226  lv = 0;
227  for (lvcite = lvs->begin(); lvcite != lvs->end(); lvcite++)
228  if ((*lvcite)->GetName() == namv) {
229  lv = (*lvcite);
230  break;
231  }
232  fibre1LV.push_back(lv);
233  edm::LogInfo("HcalSim") << "HCalSD: (" << i << ") " << fibreNames[i]
234  << " LV " << fibre1LV[i];
235  }
236 
237  // Geometry parameters for HF
238  value = "HFFibreBundleConical";
239  DDSpecificsFilter filter5;
240  DDValue ddv5(attribute,value,0);
241  filter5.setCriteria(ddv5,DDCompOp::equals);
242  DDFilteredView fv5(cpv);
243  fv5.addFilter(filter5);
244  fibreNames = getNames(fv5);
245  edm::LogInfo("HcalSim") << "HCalSD: Names to be tested for " << attribute
246  << " = " << value << " have " << fibreNames.size()
247  << " entries";
248  for (unsigned int i=0; i<fibreNames.size(); ++i) {
249  G4String namv = fibreNames[i];
250  lv = 0;
251  for (lvcite = lvs->begin(); lvcite != lvs->end(); ++lvcite)
252  if ((*lvcite)->GetName() == namv) {
253  lv = (*lvcite);
254  break;
255  }
256  fibre2LV.push_back(lv);
257  edm::LogInfo("HcalSim") << "HCalSD: (" << i << ") " << fibreNames[i]
258  << " LV " << fibre2LV[i];
259  }
260  if (fibre1LV.size() > 0 || fibre2LV.size() > 0)
261  showerBundle = new HFShowerFibreBundle (name, cpv, p);
262  }
263 
264  //Material list for HB/HE/HO sensitive detectors
265  const G4MaterialTable * matTab = G4Material::GetMaterialTable();
266  std::vector<G4Material*>::const_iterator matite;
267  attribute = "OnlyForHcalSimNumbering";
268  value = "any";
269  DDSpecificsFilter filter2;
270  DDValue ddv2(attribute,value,0);
271  filter2.setCriteria(ddv2, DDCompOp::not_equals,
272  DDLogOp::AND, true, true);
273  DDFilteredView fv2(cpv);
274  fv2.addFilter(filter2);
275  bool dodet = fv2.firstChild();
276  DDsvalues_type sv(fv2.mergedSpecifics());
277 
278  while (dodet) {
279  const DDLogicalPart & log = fv2.logicalPart();
280  G4String namx = log.name().name();
281  if (!isItHF(namx) && !isItFibre(namx)) {
282  bool notIn = true;
283  for (unsigned int i=0; i<matNames.size(); ++i) {
284  if (!strcmp(matNames[i].c_str(),log.material().name().name().c_str())){
285  notIn = false;
286  break;
287  }
288  }
289  if (notIn) {
290  namx = log.material().name().name();
291  matNames.push_back(namx);
292  G4Material* mat = nullptr;
293  for (matite = matTab->begin(); matite != matTab->end(); ++matite) {
294  if ((*matite)->GetName() == namx) {
295  mat = (*matite);
296  break;
297  }
298  }
299  materials.push_back(mat);
300  }
301  }
302  dodet = fv2.next();
303  }
304 
305  edm::LogInfo("HcalSim") << "HCalSD: Material names for " << attribute
306  << " = " << name << ":";
307  for (unsigned int i=0; i<matNames.size(); ++i)
308  edm::LogInfo("HcalSim") << "HCalSD: (" << i << ") " << matNames[i]
309  << " pointer " << materials[i];
310 
311  mumPDG = mupPDG = 0;
312 
313  if (useLayerWt) readWeightFromFile(file);
314 
315  for (int i=0; i<9; ++i) hit_[i] = time_[i]= dist_[i] = 0;
316  hzvem = hzvhad = 0;
317 
318  if (ageingFlagHE) m_HEDarkening = new HEDarkening();
319  if (ageingFlagHF) m_HFDarkening = new HFDarkening();
320 #ifdef plotDebug
322 
323  if ( tfile.isAvailable() ) {
324  static const char * const labels[] = {"HB", "HE", "HO", "HF Absorber", "HF PMT",
325  "HF Absorber Long", "HF Absorber Short",
326  "HF PMT Long", "HF PMT Short"};
327  TFileDirectory hcDir = tfile->mkdir("ProfileFromHCalSD");
328  char name[20], title[60];
329  for (int i=0; i<9; ++i) {
330  sprintf (title, "Hit energy in %s", labels[i]);
331  sprintf (name, "HCalSDHit%d", i);
332  hit_[i] = hcDir.make<TH1F>(name, title, 2000, 0., 2000.);
333  sprintf (title, "Energy (MeV)");
334  hit_[i]->GetXaxis()->SetTitle(title);
335  hit_[i]->GetYaxis()->SetTitle("Hits");
336  sprintf (title, "Time of the hit in %s", labels[i]);
337  sprintf (name, "HCalSDTime%d", i);
338  time_[i] = hcDir.make<TH1F>(name, title, 2000, 0., 2000.);
339  sprintf (title, "Time (ns)");
340  time_[i]->GetXaxis()->SetTitle(title);
341  time_[i]->GetYaxis()->SetTitle("Hits");
342  sprintf (title, "Longitudinal profile in %s", labels[i]);
343  sprintf (name, "HCalSDDist%d", i);
344  dist_[i] = hcDir.make<TH1F>(name, title, 2000, 0., 2000.);
345  sprintf (title, "Distance (mm)");
346  dist_[i]->GetXaxis()->SetTitle(title);
347  dist_[i]->GetYaxis()->SetTitle("Hits");
348  }
349  if (useHF && (!useParam)) {
350  hzvem = hcDir.make<TH1F>("hzvem", "Longitudinal Profile (EM Part)",330,0.0,1650.0);
351  hzvem->GetXaxis()->SetTitle("Longitudinal Profile (EM Part)");
352  hzvhad = hcDir.make<TH1F>("hzvhad","Longitudinal Profile (Had Part)",330,0.0,1650.0);
353  hzvhad->GetXaxis()->SetTitle("Longitudinal Profile (Hadronic Part)");
354  }
355  }
356 #endif
357 }
#define LogDebug(id)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
bool useParam
Definition: HCalSD.h:93
double eminHitHE
Definition: HCalSD.h:94
HFShowerParam * showerParam
Definition: HCalSD.h:86
TH1F * time_[9]
Definition: HCalSD.h:103
double kmaxNeutron
Definition: CaloSD.h:134
const N & name() const
Definition: DDBase.h:78
bool useLayerWt
Definition: HCalSD.h:91
bool useFibreBundle
Definition: HCalSD.h:91
double betaThr
Definition: HCalSD.h:92
double deliveredLumi
Definition: HCalSD.h:95
HFShowerFibreBundle * showerBundle
Definition: HCalSD.h:88
std::vector< G4LogicalVolume * > fibre1LV
Definition: HCalSD.h:101
std::vector< G4LogicalVolume * > fibreLV
Definition: HCalSD.h:101
double eminHitHB
Definition: HCalSD.h:94
bool useShowerLibrary
Definition: HCalSD.h:93
std::vector< double > getDDDArray(const std::string &, const DDsvalues_type &)
Definition: HCalSD.cc:671
double birk2
Definition: HCalSD.h:92
bool usePMTHit
Definition: HCalSD.h:91
void setNumberingScheme(HcalNumberingScheme *)
Definition: HCalSD.cc:585
double birk1
Definition: HCalSD.h:92
double kmaxProton
Definition: CaloSD.h:134
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
bool isItHF(G4Step *)
Definition: HCalSD.cc:716
TH1F * hzvhad
Definition: HCalSD.h:103
CaloSD(G4String aSDname, const DDCompactView &cpv, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *, float timeSlice=1., bool ignoreTkID=false)
Definition: CaloSD.cc:24
double eminHitHF
Definition: HCalSD.h:94
const double MeV
TH1F * hit_[9]
Definition: HCalSD.h:103
bool testNumber
Definition: HCalSD.h:91
std::vector< G4LogicalVolume * > pmtLV
Definition: HCalSD.h:101
std::vector< G4LogicalVolume * > hfLV
Definition: HCalSD.h:101
double kmaxIon
Definition: CaloSD.h:134
bool suppressHeavy
Definition: CaloSD.h:132
HFShower * hfshower
Definition: HCalSD.h:85
bool useBirk
Definition: HCalSD.h:91
double birk3
Definition: HCalSD.h:92
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
std::maps an index to a DDValue. The index corresponds to the index assigned to the name of the std::...
Definition: DDsvalues.h:19
bool isAvailable() const
Definition: Service.h:46
bool applyFidCut
Definition: HCalSD.h:93
TH1F * dist_[9]
Definition: HCalSD.h:103
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:88
HcalNumberingScheme * numberingScheme
Definition: HCalSD.h:83
T * make(const Args &...args) const
make new ROOT object
HFDarkening * m_HFDarkening
Definition: HCalSD.h:90
std::vector< int > hfLevels
Definition: HCalSD.h:98
virtual std::vector< std::string > getNames()
HEDarkening * m_HEDarkening
Definition: HCalSD.h:89
G4int mupPDG
Definition: HCalSD.h:96
double eminHitHO
Definition: HCalSD.h:94
TH1F * hzvem
Definition: HCalSD.h:103
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
Definition: TFileService.h:69
void readWeightFromFile(std::string)
Definition: HCalSD.cc:1093
HcalNumberingFromDDD * numberingFromDDD
Definition: HCalSD.h:82
std::vector< G4String > fibreNames
Definition: HCalSD.h:99
std::vector< G4Material * > materials
Definition: HCalSD.h:100
std::vector< G4String > hfNames
Definition: HCalSD.h:99
G4int mumPDG
Definition: HCalSD.h:96
tuple level
Definition: testEve_cfg.py:34
HFShowerPMT * showerPMT
Definition: HCalSD.h:87
HFShowerLibrary * showerLibrary
Definition: HCalSD.h:84
std::vector< G4LogicalVolume * > fibre2LV
Definition: HCalSD.h:101
const std::string & name() const
Returns the name.
Definition: DDName.cc:87
const DDMaterial & material(void) const
Returns a reference object of the material this LogicalPart is made of.
void setCriteria(const DDValue &nameVal, DDCompOp, DDLogOp l=DDLogOp::AND, bool asString=true, bool merged=true)
Definition: DDFilter.cc:245
std::vector< G4String > matNames
Definition: HCalSD.h:99
bool isItFibre(G4LogicalVolume *)
Definition: HCalSD.cc:734
bool useHF
Definition: HCalSD.h:93
HcalDDDSimConstants * hcalConstants
Definition: HCalSD.h:81
The DDGenericFilter is a runtime-parametrized Filter looking on DDSpecifcs.
Definition: DDFilter.h:32
HCalSD::~HCalSD ( )
virtual

Definition at line 359 of file HCalSD.cc.

References hfshower, m_HEDarkening, m_HFDarkening, numberingFromDDD, numberingScheme, showerBundle, showerLibrary, showerParam, and showerPMT.

359  {
360 
362  if (numberingScheme) delete numberingScheme;
363  if (showerLibrary) delete showerLibrary;
364  if (hfshower) delete hfshower;
365  if (showerParam) delete showerParam;
366  if (showerPMT) delete showerPMT;
367  if (showerBundle) delete showerBundle;
368  if (m_HEDarkening) delete m_HEDarkening;
369  if (m_HFDarkening) delete m_HFDarkening;
370 }
HFShowerParam * showerParam
Definition: HCalSD.h:86
HFShowerFibreBundle * showerBundle
Definition: HCalSD.h:88
HFShower * hfshower
Definition: HCalSD.h:85
HcalNumberingScheme * numberingScheme
Definition: HCalSD.h:83
HFDarkening * m_HFDarkening
Definition: HCalSD.h:90
HEDarkening * m_HEDarkening
Definition: HCalSD.h:89
HcalNumberingFromDDD * numberingFromDDD
Definition: HCalSD.h:82
HFShowerPMT * showerPMT
Definition: HCalSD.h:87
HFShowerLibrary * showerLibrary
Definition: HCalSD.h:84

Member Function Documentation

bool HCalSD::filterHit ( CaloG4Hit aHit,
double  time 
)
protectedvirtual

Reimplemented from CaloSD.

Definition at line 640 of file HCalSD.cc.

References eminHitHB, eminHitHE, eminHitHF, eminHitHO, CaloG4Hit::getEnergyDeposit(), CaloG4Hit::getUnitID(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, dtDQMClient_cfg::threshold, and CaloSD::tmaxHit.

640  {
641  double threshold=0;
642  DetId theId(aHit->getUnitID());
643  switch (theId.subdetId()) {
644  case HcalBarrel:
645  threshold = eminHitHB; break;
646  case HcalEndcap:
647  threshold = eminHitHE; break;
648  case HcalOuter:
649  threshold = eminHitHO; break;
650  case HcalForward:
651  threshold = eminHitHF; break;
652  default:
653  break;
654  }
655  return ((time <= tmaxHit) && (aHit->getEnergyDeposit() > threshold));
656 }
double eminHitHE
Definition: HCalSD.h:94
double eminHitHB
Definition: HCalSD.h:94
double eminHitHF
Definition: HCalSD.h:94
double eminHitHO
Definition: HCalSD.h:94
double tmaxHit
Definition: CaloSD.h:123
Definition: DetId.h:18
uint32_t getUnitID() const
Definition: CaloG4Hit.h:69
double getEnergyDeposit() const
Definition: CaloG4Hit.h:81
std::vector< double > HCalSD::getDDDArray ( const std::string &  str,
const DDsvalues_type sv 
)
private

Definition at line 671 of file HCalSD.cc.

References DDfetch(), DDValue::doubles(), Exception, LogDebug, and relativeConstraints::value.

Referenced by HCalSD().

672  {
673 #ifdef DebugLog
674  LogDebug("HcalSim") << "HCalSD:getDDDArray called for " << str;
675 #endif
676  DDValue value(str);
677  if (DDfetch(&sv,value)) {
678 #ifdef DebugLog
679  LogDebug("HcalSim") << value;
680 #endif
681  const std::vector<double> & fvec = value.doubles();
682  int nval = fvec.size();
683  if (nval < 1) {
684  edm::LogError("HcalSim") << "HCalSD : # of " << str << " bins " << nval
685  << " < 2 ==> illegal";
686  throw cms::Exception("Unknown", "HCalSD") << "nval < 2 for array " << str << "\n";
687  }
688 
689  return fvec;
690  } else {
691  edm::LogError("HcalSim") << "HCalSD : cannot get array " << str;
692  throw cms::Exception("Unknown", "HCalSD") << "cannot get array " << str << "\n";
693  }
694 }
#define LogDebug(id)
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:80
double HCalSD::getEnergyDeposit ( G4Step *  aStep)
virtual

Reimplemented from CaloSD.

Definition at line 476 of file HCalSD.cc.

References birk1, birk2, birk3, HEDarkening::degradation(), deliveredLumi, HLT_25ns10e33_v2_cff::depth, eta, CaloSD::getAttenuation(), CaloSD::getResponseWt(), HcalDetId::ietaAbs(), isItScintillator(), TrackInformation::isPrimary(), ke, CaloSD::kmaxIon, CaloSD::kmaxNeutron, CaloSD::kmaxProton, layer0wt, layerWeight(), m_HEDarkening, MeV, phi, setDetUnitId(), CaloSD::suppressHeavy, testNumber, CaloSD::theTrack, HcalTestNumbering::unpackHcalIndex(), useBirk, useLayerWt, histoStyle::weight, and z.

476  {
477  double destep = aStep->GetTotalEnergyDeposit();
478  double weight = 1;
479  G4Track* theTrack = aStep->GetTrack();
480 
481  const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
482  int depth = (touch->GetReplicaNumber(0))%10;
483  int det = ((touch->GetReplicaNumber(1))/1000)-3;
484  if (depth==0 && (det==0 || det==1)) weight = layer0wt[det];
485  if (useLayerWt) {
486  int lay = (touch->GetReplicaNumber(0)/10)%100 + 1;
487  G4ThreeVector hitPoint = aStep->GetPreStepPoint()->GetPosition();
488  weight = layerWeight(det+3, hitPoint, depth, lay);
489  }
490 
491  if (m_HEDarkening !=0 && det == 1) {
492  int lay = (touch->GetReplicaNumber(0)/10)%100 + 1;
493  int ieta;
494  uint32_t detid = setDetUnitId(aStep);
495  if(testNumber) {
496  int det, z, depth, eta, phi, lay;
497  HcalTestNumbering::unpackHcalIndex(detid,det,z,depth,eta,phi,lay);
498  ieta = eta;
499  }
500  else ieta = HcalDetId(detid).ietaAbs();
501 #ifdef DebugLog
502  edm::LogInfo("HcalSim") << "HCalSD:HE_Darkening >>> ieta: "<< ieta //<< " vs. ietaAbs(): " << HcalDetId(detid).ietaAbs()
503  << " lay: " << lay-2;
504 #endif
505  float dweight = m_HEDarkening->degradation(deliveredLumi,ieta,lay-2);//NB:diff. layer count
506  weight *= dweight;
507 #ifdef DebugLog
508  edm::LogInfo("HcalSim") << "HCalSD: >>> Lumi: " << deliveredLumi
509  << " coefficient = " << dweight;
510 #endif
511  }
512 
513  if (suppressHeavy) {
514  TrackInformation * trkInfo = (TrackInformation *)(theTrack->GetUserInformation());
515  if (trkInfo) {
516  int pdg = theTrack->GetDefinition()->GetPDGEncoding();
517  if (!(trkInfo->isPrimary())) { // Only secondary particles
518  double ke = theTrack->GetKineticEnergy()/MeV;
519  if ( pdg/1000000000 == 1 && (pdg/10000)%100 > 0 &&
520  (pdg/10)%100 > 0 && ke <kmaxIon ) weight = 0;
521  if ((pdg == 2212) && (ke < kmaxProton)) weight = 0;
522  if ((pdg == 2112) && (ke < kmaxNeutron)) weight = 0;
523 #ifdef DebugLog
524  if (weight == 0)
525  edm::LogInfo("HcalSim") << "HCalSD:Ignore Track "
526  << theTrack->GetTrackID() << " Type "
527  << theTrack->GetDefinition()->GetParticleName()
528  << " Kinetic Energy " << ke << " MeV";
529 #endif
530  }
531  }
532  }
533 #ifdef DebugLog
534  double weight0 = weight;
535 #endif
536  if (useBirk) {
537  G4Material* mat = aStep->GetPreStepPoint()->GetMaterial();
538  if (isItScintillator(mat)) weight *= getAttenuation(aStep, birk1, birk2, birk3);
539  }
540  double wt1 = getResponseWt(theTrack);
541  double wt2 = theTrack->GetWeight();
542  /*
543  if (wt2 != 1.0) {
544  edm::LogInfo("HcalSim") << "HCalSD: Detector " << det+3 << " Depth "
545  << depth << " weight= " << weight << " wt1= "
546  << wt1 << " wt2= " << wt2;
547  const G4VProcess* pr = theTrack->GetCreatorProcess();
548  if (pr) {
549  edm::LogInfo("HcalSim") << theTrack->GetDefinition()->GetParticleName()
550  << " " << theTrack->GetKineticEnergy()
551  << " Id=" << theTrack->GetTrackID()
552  << " IdP=" << theTrack->GetParentID()
553  << " from " << pr->GetProcessName();
554  } else {
555  edm::LogInfo("HcalSim") << theTrack->GetDefinition()->GetParticleName()
556  << " " << theTrack->GetKineticEnergy()
557  << " Id=" << theTrack->GetTrackID()
558  << " IdP=" << theTrack->GetParentID();
559  }
560  }
561  */
562 #ifdef DebugLog
563  edm::LogInfo("HcalSim") << "HCalSD: Detector " << det+3 << " Depth " << depth
564  << " weight " << weight0 << " " << weight << " " << wt1
565  << " " << wt2;
566 #endif
567  double edep = weight*wt1*destep;
568  if(wt2 > 0.0) { edep *= wt2; }
569  return edep;
570 }
std::vector< double > layer0wt
Definition: HCalSD.h:97
double kmaxNeutron
Definition: CaloSD.h:134
bool useLayerWt
Definition: HCalSD.h:91
double deliveredLumi
Definition: HCalSD.h:95
virtual uint32_t setDetUnitId(G4Step *step)
Definition: HCalSD.cc:572
double birk2
Definition: HCalSD.h:92
double birk1
Definition: HCalSD.h:92
double kmaxProton
Definition: CaloSD.h:134
const double MeV
bool testNumber
Definition: HCalSD.h:91
double kmaxIon
Definition: CaloSD.h:134
bool suppressHeavy
Definition: CaloSD.h:132
bool isItScintillator(G4Material *)
Definition: HCalSD.cc:764
bool useBirk
Definition: HCalSD.h:91
double birk3
Definition: HCalSD.h:92
static void unpackHcalIndex(const uint32_t &idx, int &det, int &z, int &depth, int &eta, int &phi, int &lay)
double getAttenuation(G4Step *aStep, double birk1, double birk2, double birk3)
Definition: CaloSD.cc:465
HEDarkening * m_HEDarkening
Definition: HCalSD.h:89
G4Track * theTrack
Definition: CaloSD.h:118
int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.cc:119
int ke
bool isPrimary() const
double layerWeight(int, const G4ThreeVector &, int, int)
Definition: HCalSD.cc:1119
double getResponseWt(G4Track *)
Definition: CaloSD.cc:607
int weight
Definition: histoStyle.py:50
float degradation(float intlumi, int ieta, int lay)
Definition: HEDarkening.cc:52
void HCalSD::getFromLibrary ( G4Step *  step,
double  weight 
)
private

Definition at line 787 of file HCalSD.cc.

References CaloSD::checkHit(), CaloSD::createNewHit(), CaloSD::currentHit, CaloSD::currentID, HLT_25ns10e33_v2_cff::depth, CaloSD::edepositEM, CaloSD::edepositHAD, CaloSD::emPDG, CaloSD::epPDG, CaloSD::gammaPDG, HFShowerLibrary::getHits(), GetVolume(), GeV, i, isItinFidVolume(), GetRecoTauVFromDQM_MC_cff::kk, convertSQLiteXML::ok, plotHF(), plotProfile(), CaloSD::posGlobal, CaloSD::preStepPoint, CaloSD::previousID, CaloSD::resetForNewPrimary(), setDetUnitId(), CaloHitID::setID(), setTrackID(), showerLibrary, CaloSD::theTrack, and CaloSD::updateHit().

Referenced by ProcessHits().

787  {
788  preStepPoint = aStep->GetPreStepPoint();
789  theTrack = aStep->GetTrack();
790  int det = 5;
791  bool ok;
792 
793  std::vector<HFShowerLibrary::Hit> hits = showerLibrary->getHits(aStep, ok, weight, false);
794 
795  double etrack = preStepPoint->GetKineticEnergy();
796  int primaryID = setTrackID(aStep);
797 
798  // Reset entry point for new primary
799  posGlobal = preStepPoint->GetPosition();
800  resetForNewPrimary(posGlobal, etrack);
801 
802  G4int particleCode = theTrack->GetDefinition()->GetPDGEncoding();
803  if (particleCode==emPDG || particleCode==epPDG || particleCode==gammaPDG) {
804  edepositEM = 1.*GeV;
805  edepositHAD = 0.;
806  } else {
807  edepositEM = 0.;
808  edepositHAD = 1.*GeV;
809  }
810 #ifdef DebugLog
811  edm::LogInfo("HcalSim") << "HCalSD::getFromLibrary " <<hits.size()
812  << " hits for " << GetName() << " of " << primaryID
813  << " with " << theTrack->GetDefinition()->GetParticleName()
814  << " of " << preStepPoint->GetKineticEnergy()/GeV << " GeV";
815 #endif
816  for (unsigned int i=0; i<hits.size(); ++i) {
817  G4ThreeVector hitPoint = hits[i].position;
818  if (isItinFidVolume (hitPoint)) {
819  int depth = hits[i].depth;
820  double time = hits[i].time;
821  unsigned int unitID = setDetUnitId(det, hitPoint, depth);
822  currentID.setID(unitID, time, primaryID, 0);
823 #ifdef plotDebug
824  plotProfile(aStep, hitPoint, 1.0*GeV, time, depth);
825  bool emType = false;
826  if (particleCode==emPDG || particleCode==epPDG || particleCode==gammaPDG)
827  emType = true;
828  plotHF(hitPoint,emType);
829 #endif
830 
831  // check if it is in the same unit and timeslice as the previous one
832  if (currentID == previousID) {
834  } else {
835  if (!checkHit()) currentHit = createNewHit();
836  }
837  }
838  }
839 
840  //Now kill the current track
841  if (ok) {
842  theTrack->SetTrackStatus(fStopAndKill);
843  G4TrackVector tv = *(aStep->GetSecondary());
844  for (unsigned int kk=0; kk<tv.size(); ++kk)
845  if (tv[kk]->GetVolume() == preStepPoint->GetPhysicalVolume())
846  tv[kk]->SetTrackStatus(fStopAndKill);
847  }
848 }
float edepositEM
Definition: CaloSD.h:121
int i
Definition: DBlmapReader.cc:9
G4int emPDG
Definition: CaloSD.h:136
const double GeV
Definition: MathUtil.h:16
void updateHit(CaloG4Hit *)
Definition: CaloSD.cc:440
bool isItinFidVolume(G4ThreeVector &)
Definition: HCalSD.cc:770
std::vector< Hit > getHits(G4Step *aStep, bool &ok, double weight, bool onlyLong=false)
virtual uint32_t setDetUnitId(G4Step *step)
Definition: HCalSD.cc:572
int setTrackID(G4Step *step)
Definition: HCalSD.cc:1073
G4ThreeVector posGlobal
Definition: CaloSD.h:113
G4bool checkHit()
Definition: CaloSD.cc:331
void resetForNewPrimary(const G4ThreeVector &, double)
Definition: CaloSD.cc:454
float edepositHAD
Definition: CaloSD.h:121
G4int epPDG
Definition: CaloSD.h:136
void plotHF(G4ThreeVector &pos, bool emType)
Definition: HCalSD.cc:1188
G4int gammaPDG
Definition: CaloSD.h:136
CaloHitID previousID
Definition: CaloSD.h:117
CaloG4Hit * currentHit
Definition: CaloSD.h:128
void plotProfile(G4Step *step, const G4ThreeVector &pos, double edep, double time, int id)
Definition: HCalSD.cc:1141
G4Track * theTrack
Definition: CaloSD.h:118
void setID(uint32_t unitID, double timeSlice, int trackID, uint16_t depth=0)
Definition: CaloHitID.cc:44
G4StepPoint * preStepPoint
Definition: CaloSD.h:120
static const G4LogicalVolume * GetVolume(const std::string &name)
CaloHitID currentID
Definition: CaloSD.h:117
int weight
Definition: histoStyle.py:50
HFShowerLibrary * showerLibrary
Definition: HCalSD.h:84
CaloG4Hit * createNewHit()
Definition: CaloSD.cc:363
void HCalSD::getFromParam ( G4Step *  step,
double  weight 
)
private

Definition at line 902 of file HCalSD.cc.

References CaloSD::checkHit(), CaloSD::createNewHit(), CaloSD::currentHit, CaloSD::currentID, HLT_25ns10e33_v2_cff::depth, CaloSD::edepositEM, CaloSD::edepositHAD, HFShowerParam::getHits(), GeV, i, plotProfile(), CaloSD::posGlobal, CaloSD::preStepPoint, CaloSD::previousID, setDetUnitId(), CaloHitID::setID(), setTrackID(), showerParam, and CaloSD::updateHit().

Referenced by ProcessHits().

902  {
903  std::vector<HFShowerParam::Hit> hits = showerParam->getHits(aStep, weight);
904  int nHit = static_cast<int>(hits.size());
905 
906  if (nHit > 0) {
907  preStepPoint = aStep->GetPreStepPoint();
908  int primaryID = setTrackID(aStep);
909 
910  int det = 5;
911 #ifdef DebugLog
912  edm::LogInfo("HcalSim") << "HCalSD::getFromParam " << nHit << " hits for "
913  << GetName() << " of " << primaryID << " with "
914  << aStep->GetTrack()->GetDefinition()->GetParticleName()
915  << " of " << preStepPoint->GetKineticEnergy()/GeV
916  << " GeV in detector type " << det;
917 #endif
918  for (int i = 0; i<nHit; ++i) {
919  G4ThreeVector hitPoint = hits[i].position;
920  int depth = hits[i].depth;
921  double time = hits[i].time;
922  unsigned int unitID = setDetUnitId(det, hitPoint, depth);
923  currentID.setID(unitID, time, primaryID, 0);
924  edepositEM = hits[i].edep*GeV;
925  edepositHAD = 0.;
926 #ifdef plotDebug
927  plotProfile(aStep, hitPoint, edepositEM, time, depth);
928 #endif
929 
930  // check if it is in the same unit and timeslice as the previous one
931  if (currentID == previousID) {
933  } else {
934  posGlobal = preStepPoint->GetPosition();
935  if (!checkHit()) currentHit = createNewHit();
936  }
937  }
938  }
939 }
float edepositEM
Definition: CaloSD.h:121
int i
Definition: DBlmapReader.cc:9
HFShowerParam * showerParam
Definition: HCalSD.h:86
const double GeV
Definition: MathUtil.h:16
void updateHit(CaloG4Hit *)
Definition: CaloSD.cc:440
virtual uint32_t setDetUnitId(G4Step *step)
Definition: HCalSD.cc:572
int setTrackID(G4Step *step)
Definition: HCalSD.cc:1073
G4ThreeVector posGlobal
Definition: CaloSD.h:113
G4bool checkHit()
Definition: CaloSD.cc:331
float edepositHAD
Definition: CaloSD.h:121
CaloHitID previousID
Definition: CaloSD.h:117
CaloG4Hit * currentHit
Definition: CaloSD.h:128
void plotProfile(G4Step *step, const G4ThreeVector &pos, double edep, double time, int id)
Definition: HCalSD.cc:1141
void setID(uint32_t unitID, double timeSlice, int trackID, uint16_t depth=0)
Definition: CaloHitID.cc:44
G4StepPoint * preStepPoint
Definition: CaloSD.h:120
CaloHitID currentID
Definition: CaloSD.h:117
std::vector< Hit > getHits(G4Step *aStep, double weight)
int weight
Definition: histoStyle.py:50
CaloG4Hit * createNewHit()
Definition: CaloSD.cc:363
void HCalSD::getHitFibreBundle ( G4Step *  step,
bool  type 
)
private

Definition at line 1009 of file HCalSD.cc.

References beta, CaloSD::checkHit(), CaloSD::createNewHit(), CaloSD::currentHit, CaloSD::currentID, TauDecayModes::dec, HLT_25ns10e33_v2_cff::depth, CaloSD::edepositEM, CaloSD::edepositHAD, CaloSD::energyCut, HFShowerFibreBundle::getHits(), HFShowerFibreBundle::getRadius(), HcalNumberingScheme::getUnitID(), GeV, HcalForward, LogDebug, modifyDepth(), numberingFromDDD, numberingScheme, phi, plotProfile(), CaloSD::posGlobal, CaloSD::preStepPoint, CaloSD::previousID, CaloSD::resetForNewPrimary(), findQualityFiles::rr, CaloHitID::setID(), showerBundle, CaloSD::theTrack, tmp, HcalNumberingFromDDD::unitID(), and CaloSD::updateHit().

Referenced by ProcessHits().

1009  {
1010  preStepPoint = aStep->GetPreStepPoint();
1011  theTrack = aStep->GetTrack();
1012  double edep = showerBundle->getHits(aStep, type);
1013 
1014  if (edep >= 0) {
1015  double etrack = preStepPoint->GetKineticEnergy();
1016  int primaryID = 0;
1017  if (etrack >= energyCut) {
1018  primaryID = theTrack->GetTrackID();
1019  } else {
1020  primaryID = theTrack->GetParentID();
1021  if (primaryID == 0) primaryID = theTrack->GetTrackID();
1022  }
1023  // Reset entry point for new primary
1024  posGlobal = preStepPoint->GetPosition();
1025  resetForNewPrimary(posGlobal, etrack);
1026 
1027  //
1028  int det = static_cast<int>(HcalForward);
1029  G4ThreeVector hitPoint = preStepPoint->GetPosition();
1030  double rr = (hitPoint.x()*hitPoint.x() + hitPoint.y()*hitPoint.y());
1031  double phi = (rr == 0. ? 0. :atan2(hitPoint.y(),hitPoint.x()));
1032  double etaR = showerBundle->getRadius();
1033  int depth = 1;
1034  if (etaR < 0) {
1035  depth = 2;
1036  etaR =-etaR;
1037  }
1038  if (hitPoint.z() < 0) etaR =-etaR;
1039 #ifdef DebugLog
1040  LogDebug("HcalSim") << "HCalSD::Hit for Detector " << det << " etaR "
1041  << etaR << " phi " << phi/deg << " depth " <<depth;
1042 #endif
1043  double time = (aStep->GetPostStepPoint()->GetGlobalTime());
1044  uint32_t unitID = 0;
1045  if (numberingFromDDD) {
1046  HcalNumberingFromDDD::HcalID tmp = numberingFromDDD->unitID(det,etaR,phi,depth,1);
1047  modifyDepth(tmp);
1048  if (numberingScheme) unitID = numberingScheme->getUnitID(tmp);
1049  }
1050  if (type) currentID.setID(unitID, time, primaryID, 3);
1051  else currentID.setID(unitID, time, primaryID, 2);
1052 
1053  edepositHAD = aStep->GetTotalEnergyDeposit();
1054  edepositEM =-edepositHAD + (edep*GeV);
1055 #ifdef plotDebug
1056  plotProfile(aStep, hitPoint, edep*GeV, time, depth);
1057 #endif
1058 #ifdef DebugLog
1059  double beta = preStepPoint->GetBeta();
1060  LogDebug("HcalSim") << "HCalSD::getHitFibreBundle 1 hit for " << GetName()
1061  << " of " << primaryID << " with "
1062  << theTrack->GetDefinition()->GetParticleName()
1063  << " of " << preStepPoint->GetKineticEnergy()/GeV
1064  << " GeV with velocity " << beta << " UnitID "
1065  << std::hex << unitID << std::dec;
1066 #endif
1067  // check if it is in the same unit and timeslice as the previous one
1069  else if (!checkHit()) currentHit = createNewHit();
1070  } // non-zero energy deposit
1071 }
#define LogDebug(id)
float edepositEM
Definition: CaloSD.h:121
const double beta
double energyCut
Definition: CaloSD.h:123
type
Definition: HCALResponse.h:21
const double GeV
Definition: MathUtil.h:16
void updateHit(CaloG4Hit *)
Definition: CaloSD.cc:440
virtual uint32_t getUnitID(const HcalNumberingFromDDD::HcalID &id)
HFShowerFibreBundle * showerBundle
Definition: HCalSD.h:88
double getHits(G4Step *aStep, bool type)
G4ThreeVector posGlobal
Definition: CaloSD.h:113
void modifyDepth(HcalNumberingFromDDD::HcalID &id)
Definition: HCalSD.cc:1197
G4bool checkHit()
Definition: CaloSD.cc:331
void resetForNewPrimary(const G4ThreeVector &, double)
Definition: CaloSD.cc:454
float edepositHAD
Definition: CaloSD.h:121
HcalNumberingScheme * numberingScheme
Definition: HCalSD.h:83
CaloHitID previousID
Definition: CaloSD.h:117
CaloG4Hit * currentHit
Definition: CaloSD.h:128
void plotProfile(G4Step *step, const G4ThreeVector &pos, double edep, double time, int id)
Definition: HCalSD.cc:1141
G4Track * theTrack
Definition: CaloSD.h:118
void setID(uint32_t unitID, double timeSlice, int trackID, uint16_t depth=0)
Definition: CaloHitID.cc:44
G4StepPoint * preStepPoint
Definition: CaloSD.h:120
CaloHitID currentID
Definition: CaloSD.h:117
HcalNumberingFromDDD * numberingFromDDD
Definition: HCalSD.h:82
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
HcalID unitID(int det, const CLHEP::Hep3Vector &pos, int depth, int lay=-1) const
CaloG4Hit * createNewHit()
Definition: CaloSD.cc:363
void HCalSD::getHitPMT ( G4Step *  step)
private

Definition at line 941 of file HCalSD.cc.

References beta, CaloSD::checkHit(), CaloSD::createNewHit(), CaloSD::currentHit, CaloSD::currentID, TauDecayModes::dec, HLT_25ns10e33_v2_cff::depth, CaloSD::edepositEM, CaloSD::edepositHAD, CaloSD::energyCut, HFShowerPMT::getHits(), HFShowerPMT::getRadius(), HcalNumberingScheme::getUnitID(), GeV, HcalForward, LogDebug, modifyDepth(), numberingFromDDD, numberingScheme, phi, plotProfile(), CaloSD::posGlobal, CaloSD::preStepPoint, CaloSD::previousID, CaloSD::resetForNewPrimary(), findQualityFiles::rr, CaloHitID::setID(), showerPMT, CaloSD::theTrack, tmp, HcalNumberingFromDDD::unitID(), and CaloSD::updateHit().

Referenced by ProcessHits().

941  {
942 
943  preStepPoint = aStep->GetPreStepPoint();
944  theTrack = aStep->GetTrack();
945  double edep = showerPMT->getHits(aStep);
946 
947  if (edep >= 0) {
948  double etrack = preStepPoint->GetKineticEnergy();
949  int primaryID = 0;
950  if (etrack >= energyCut) {
951  primaryID = theTrack->GetTrackID();
952  } else {
953  primaryID = theTrack->GetParentID();
954  if (primaryID == 0) primaryID = theTrack->GetTrackID();
955  }
956  // Reset entry point for new primary
957  posGlobal = preStepPoint->GetPosition();
958  resetForNewPrimary(posGlobal, etrack);
959 
960  //
961  int det = static_cast<int>(HcalForward);
962  G4ThreeVector hitPoint = preStepPoint->GetPosition();
963  double rr = (hitPoint.x()*hitPoint.x() + hitPoint.y()*hitPoint.y());
964  double phi = (rr == 0. ? 0. :atan2(hitPoint.y(),hitPoint.x()));
965  double etaR = showerPMT->getRadius();
966  int depth = 1;
967  if (etaR < 0) {
968  depth = 2;
969  etaR =-etaR;
970  }
971  if (hitPoint.z() < 0) etaR =-etaR;
972 #ifdef DebugLog
973  edm::LogInfo("HcalSim") << "HCalSD::Hit for Detector " << det << " etaR "
974  << etaR << " phi " << phi/deg << " depth " <<depth;
975 #endif
976  double time = (aStep->GetPostStepPoint()->GetGlobalTime());
977  uint32_t unitID = 0;
978  if (numberingFromDDD) {
980  depth,1);
981  modifyDepth(tmp);
982  if (numberingScheme) unitID = numberingScheme->getUnitID(tmp);
983  }
984  currentID.setID(unitID, time, primaryID, 1);
985 
986  edepositHAD = aStep->GetTotalEnergyDeposit();
987  edepositEM =-edepositHAD + (edep*GeV);
988 #ifdef plotDebug
989  plotProfile(aStep, hitPoint, edep*GeV, time, depth);
990 #endif
991 #ifdef DebugLog
992  double beta = preStepPoint->GetBeta();
993  LogDebug("HcalSim") << "HCalSD::getHitPMT 1 hit for " << GetName()
994  << " of " << primaryID << " with "
995  << theTrack->GetDefinition()->GetParticleName()
996  << " of " << preStepPoint->GetKineticEnergy()/GeV
997  << " GeV with velocity " << beta << " UnitID "
998  << std::hex << unitID << std::dec;
999 #endif
1000  // check if it is in the same unit and timeslice as the previous one
1001  if (currentID == previousID) {
1003  } else {
1004  if (!checkHit()) currentHit = createNewHit();
1005  }
1006  }
1007 }
#define LogDebug(id)
float edepositEM
Definition: CaloSD.h:121
const double beta
double energyCut
Definition: CaloSD.h:123
double getRadius()
Definition: HFShowerPMT.cc:137
const double GeV
Definition: MathUtil.h:16
void updateHit(CaloG4Hit *)
Definition: CaloSD.cc:440
virtual uint32_t getUnitID(const HcalNumberingFromDDD::HcalID &id)
G4ThreeVector posGlobal
Definition: CaloSD.h:113
void modifyDepth(HcalNumberingFromDDD::HcalID &id)
Definition: HCalSD.cc:1197
G4bool checkHit()
Definition: CaloSD.cc:331
void resetForNewPrimary(const G4ThreeVector &, double)
Definition: CaloSD.cc:454
float edepositHAD
Definition: CaloSD.h:121
HcalNumberingScheme * numberingScheme
Definition: HCalSD.h:83
CaloHitID previousID
Definition: CaloSD.h:117
CaloG4Hit * currentHit
Definition: CaloSD.h:128
void plotProfile(G4Step *step, const G4ThreeVector &pos, double edep, double time, int id)
Definition: HCalSD.cc:1141
G4Track * theTrack
Definition: CaloSD.h:118
void setID(uint32_t unitID, double timeSlice, int trackID, uint16_t depth=0)
Definition: CaloHitID.cc:44
G4StepPoint * preStepPoint
Definition: CaloSD.h:120
CaloHitID currentID
Definition: CaloSD.h:117
double getHits(G4Step *aStep)
Definition: HFShowerPMT.cc:91
HcalNumberingFromDDD * numberingFromDDD
Definition: HCalSD.h:82
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
HFShowerPMT * showerPMT
Definition: HCalSD.h:87
HcalID unitID(int det, const CLHEP::Hep3Vector &pos, int depth, int lay=-1) const
CaloG4Hit * createNewHit()
Definition: CaloSD.cc:363
std::vector< G4String > HCalSD::getNames ( DDFilteredView fv)
private

Definition at line 696 of file HCalSD.cc.

References DDFilteredView::firstChild(), i, dqm-mbProfile::log, DDFilteredView::logicalPart(), DDName::name(), DDBase< N, C >::name(), DDFilteredView::next(), convertSQLiteXML::ok, and tmp.

696  {
697 
698  std::vector<G4String> tmp;
699  bool dodet = fv.firstChild();
700  while (dodet) {
701  const DDLogicalPart & log = fv.logicalPart();
702  bool ok = true;
703 
704  for (unsigned int i=0; i<tmp.size(); ++i) {
705  if (!strcmp(tmp[i].c_str(), log.name().name().c_str())) {
706  ok = false;
707  break;
708  }
709  }
710  if (ok) tmp.push_back(log.name().name());
711  dodet = fv.next();
712  }
713  return tmp;
714 }
int i
Definition: DBlmapReader.cc:9
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
const N & name() const
Definition: DDBase.h:78
bool next()
set current node to the next node in the filtered tree
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:88
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
bool firstChild()
set the current node to the first child ...
const std::string & name() const
Returns the name.
Definition: DDName.cc:87
void HCalSD::hitForFibre ( G4Step *  step,
double  weight 
)
private

Definition at line 850 of file HCalSD.cc.

References CaloSD::checkHit(), CaloSD::createNewHit(), CaloSD::currentHit, CaloSD::currentID, HLT_25ns10e33_v2_cff::depth, CaloSD::edepositEM, CaloSD::edepositHAD, CaloSD::emPDG, CaloSD::epPDG, CaloSD::gammaPDG, HFShower::getHits(), GeV, hfshower, i, isItinFidVolume(), plotHF(), plotProfile(), CaloSD::posGlobal, CaloSD::preStepPoint, CaloSD::previousID, setDetUnitId(), CaloHitID::setID(), setTrackID(), CaloSD::theTrack, and CaloSD::updateHit().

Referenced by ProcessHits().

850  { // if not ParamShower
851 
852  preStepPoint = aStep->GetPreStepPoint();
853  theTrack = aStep->GetTrack();
854  int primaryID = setTrackID(aStep);
855 
856  int det = 5;
857  std::vector<HFShower::Hit> hits = hfshower->getHits(aStep, weight);
858 
859  G4int particleCode = theTrack->GetDefinition()->GetPDGEncoding();
860  if (particleCode==emPDG || particleCode==epPDG || particleCode==gammaPDG) {
861  edepositEM = 1.*GeV;
862  edepositHAD = 0.;
863  } else {
864  edepositEM = 0.;
865  edepositHAD = 1.*GeV;
866  }
867 
868 #ifdef DebugLog
869  edm::LogInfo("HcalSim") << "HCalSD::hitForFibre " << hits.size()
870  << " hits for " << GetName() << " of " << primaryID
871  << " with " << theTrack->GetDefinition()->GetParticleName()
872  << " of " << preStepPoint->GetKineticEnergy()/GeV
873  << " GeV in detector type " << det;
874 #endif
875  if (hits.size() > 0) {
876  for (unsigned int i=0; i<hits.size(); ++i) {
877  G4ThreeVector hitPoint = hits[i].position;
878  if (isItinFidVolume (hitPoint)) {
879  int depth = hits[i].depth;
880  double time = hits[i].time;
881  unsigned int unitID = setDetUnitId(det, hitPoint, depth);
882  currentID.setID(unitID, time, primaryID, 0);
883 #ifdef plotDebug
884  plotProfile(aStep, hitPoint, edepositEM, time, depth);
885  bool emType = false;
886  if (particleCode==emPDG || particleCode==epPDG || particleCode==gammaPDG)
887  emType = true;
888  plotHF(hitPoint,emType);
889 #endif
890  // check if it is in the same unit and timeslice as the previous one
891  if (currentID == previousID) {
893  } else {
894  posGlobal = preStepPoint->GetPosition();
895  if (!checkHit()) currentHit = createNewHit();
896  }
897  }
898  }
899  }
900 }
float edepositEM
Definition: CaloSD.h:121
int i
Definition: DBlmapReader.cc:9
G4int emPDG
Definition: CaloSD.h:136
const double GeV
Definition: MathUtil.h:16
void updateHit(CaloG4Hit *)
Definition: CaloSD.cc:440
bool isItinFidVolume(G4ThreeVector &)
Definition: HCalSD.cc:770
virtual uint32_t setDetUnitId(G4Step *step)
Definition: HCalSD.cc:572
int setTrackID(G4Step *step)
Definition: HCalSD.cc:1073
G4ThreeVector posGlobal
Definition: CaloSD.h:113
G4bool checkHit()
Definition: CaloSD.cc:331
HFShower * hfshower
Definition: HCalSD.h:85
float edepositHAD
Definition: CaloSD.h:121
G4int epPDG
Definition: CaloSD.h:136
void plotHF(G4ThreeVector &pos, bool emType)
Definition: HCalSD.cc:1188
G4int gammaPDG
Definition: CaloSD.h:136
std::vector< Hit > getHits(G4Step *aStep, double weight)
Definition: HFShower.cc:47
CaloHitID previousID
Definition: CaloSD.h:117
CaloG4Hit * currentHit
Definition: CaloSD.h:128
void plotProfile(G4Step *step, const G4ThreeVector &pos, double edep, double time, int id)
Definition: HCalSD.cc:1141
G4Track * theTrack
Definition: CaloSD.h:118
void setID(uint32_t unitID, double timeSlice, int trackID, uint16_t depth=0)
Definition: CaloHitID.cc:44
G4StepPoint * preStepPoint
Definition: CaloSD.h:120
CaloHitID currentID
Definition: CaloSD.h:117
int weight
Definition: histoStyle.py:50
CaloG4Hit * createNewHit()
Definition: CaloSD.cc:363
void HCalSD::initRun ( void  )
protectedvirtual

Reimplemented from CaloSD.

Definition at line 624 of file HCalSD.cc.

References hcalConstants, hfshower, HFShowerPMT::initRun(), HFShowerFibreBundle::initRun(), HFShower::initRun(), HFShowerParam::initRun(), HFShowerLibrary::initRun(), LogDebug, mumPDG, mupPDG, showerBundle, showerLibrary, showerParam, and showerPMT.

624  {
625  G4ParticleTable * theParticleTable = G4ParticleTable::GetParticleTable();
626  G4String particleName;
627  mumPDG = theParticleTable->FindParticle(particleName="mu-")->GetPDGEncoding();
628  mupPDG = theParticleTable->FindParticle(particleName="mu+")->GetPDGEncoding();
629 #ifdef DebugLog
630  LogDebug("HcalSim") << "HCalSD: Particle code for mu- = " << mumPDG
631  << " for mu+ = " << mupPDG;
632 #endif
633  if (showerLibrary) showerLibrary->initRun(theParticleTable,hcalConstants);
634  if (showerParam) showerParam->initRun(theParticleTable,hcalConstants);
635  if (hfshower) hfshower->initRun(theParticleTable,hcalConstants);
636  if (showerPMT) showerPMT->initRun(theParticleTable,hcalConstants);
637  if (showerBundle) showerBundle->initRun(theParticleTable,hcalConstants);
638 }
#define LogDebug(id)
HFShowerParam * showerParam
Definition: HCalSD.h:86
void initRun(G4ParticleTable *, HcalDDDSimConstants *)
Definition: HFShower.cc:454
HFShowerFibreBundle * showerBundle
Definition: HCalSD.h:88
void initRun(G4ParticleTable *, HcalDDDSimConstants *)
Definition: HFShowerPMT.cc:80
HFShower * hfshower
Definition: HCalSD.h:85
void initRun(G4ParticleTable *, HcalDDDSimConstants *)
G4int mupPDG
Definition: HCalSD.h:96
void initRun(G4ParticleTable *, HcalDDDSimConstants *)
G4int mumPDG
Definition: HCalSD.h:96
HFShowerPMT * showerPMT
Definition: HCalSD.h:87
HFShowerLibrary * showerLibrary
Definition: HCalSD.h:84
void initRun(G4ParticleTable *, HcalDDDSimConstants *)
HcalDDDSimConstants * hcalConstants
Definition: HCalSD.h:81
bool HCalSD::isItConicalBundle ( G4LogicalVolume *  lv)
private

Definition at line 758 of file HCalSD.cc.

References fibre2LV.

Referenced by ProcessHits().

758  {
759  std::vector<G4LogicalVolume*>::const_iterator ite = fibre2LV.begin();
760  for (; ite != fibre2LV.end(); ++ite) if (lv == *ite) return true;
761  return false;
762 }
std::vector< G4LogicalVolume * > fibre2LV
Definition: HCalSD.h:101
bool HCalSD::isItFibre ( G4LogicalVolume *  lv)
private

Definition at line 734 of file HCalSD.cc.

References fibreLV.

Referenced by HCalSD(), and ProcessHits().

734  {
735  std::vector<G4LogicalVolume*>::const_iterator ite = fibreLV.begin();
736  for (; ite != fibreLV.end(); ++ite) if (lv == *ite) return true;
737  return false;
738 }
std::vector< G4LogicalVolume * > fibreLV
Definition: HCalSD.h:101
bool HCalSD::isItFibre ( G4String  name)
private

Definition at line 740 of file HCalSD.cc.

References fibreNames.

740  {
741  std::vector<G4String>::const_iterator it = fibreNames.begin();
742  for (; it != fibreNames.end(); ++it) if (name == *it) return true;
743  return false;
744 }
std::vector< G4String > fibreNames
Definition: HCalSD.h:99
bool HCalSD::isItHF ( G4Step *  aStep)
private

Definition at line 716 of file HCalSD.cc.

References hfLevels, hfLV, and hfNames.

Referenced by HCalSD(), and ProcessHits().

716  {
717  const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
718  int levels = (touch->GetHistoryDepth()) + 1;
719  for (unsigned int it=0; it < hfNames.size(); ++it) {
720  if (levels >= hfLevels[it]) {
721  G4LogicalVolume* lv = touch->GetVolume(levels-hfLevels[it])->GetLogicalVolume();
722  if (lv == hfLV[it]) return true;
723  }
724  }
725  return false;
726 }
std::vector< G4LogicalVolume * > hfLV
Definition: HCalSD.h:101
std::vector< int > hfLevels
Definition: HCalSD.h:98
std::vector< G4String > hfNames
Definition: HCalSD.h:99
bool HCalSD::isItHF ( G4String  name)
private

Definition at line 728 of file HCalSD.cc.

References hfNames.

728  {
729  std::vector<G4String>::const_iterator it = hfNames.begin();
730  for (; it != hfNames.end(); ++it) if (name == *it) return true;
731  return false;
732 }
std::vector< G4String > hfNames
Definition: HCalSD.h:99
bool HCalSD::isItinFidVolume ( G4ThreeVector &  hitPoint)
private

Definition at line 770 of file HCalSD.cc.

References applyFidCut, and HFFibreFiducial::PMTNumber().

Referenced by getFromLibrary(), and hitForFibre().

770  {
771  bool flag = true;
772  if (applyFidCut) {
773  int npmt = HFFibreFiducial:: PMTNumber(hitPoint);
774 #ifdef DebugLog
775  edm::LogInfo("HcalSim") << "HCalSD::isItinFidVolume:#PMT= " << npmt
776  << " for hit point " << hitPoint;
777 #endif
778  if (npmt <= 0) flag = false;
779  }
780 #ifdef DebugLog
781  edm::LogInfo("HcalSim") << "HCalSD::isItinFidVolume: point " << hitPoint
782  << " return flag " << flag;
783 #endif
784  return flag;
785 }
static int PMTNumber(const G4ThreeVector &pe_effect)
bool applyFidCut
Definition: HCalSD.h:93
bool HCalSD::isItPMT ( G4LogicalVolume *  lv)
private

Definition at line 746 of file HCalSD.cc.

References pmtLV.

Referenced by ProcessHits().

746  {
747  std::vector<G4LogicalVolume*>::const_iterator ite = pmtLV.begin();
748  for (; ite != pmtLV.end(); ++ite) if (lv == *ite) return true;
749  return false;
750 }
std::vector< G4LogicalVolume * > pmtLV
Definition: HCalSD.h:101
bool HCalSD::isItScintillator ( G4Material *  mat)
private

Definition at line 764 of file HCalSD.cc.

References materials.

Referenced by getEnergyDeposit().

764  {
765  std::vector<G4Material*>::const_iterator ite = materials.begin();
766  for (; ite != materials.end(); ++ite) if (mat == *ite) return true;
767  return false;
768 }
std::vector< G4Material * > materials
Definition: HCalSD.h:100
bool HCalSD::isItStraightBundle ( G4LogicalVolume *  lv)
private

Definition at line 752 of file HCalSD.cc.

References fibre1LV.

Referenced by ProcessHits().

752  {
753  std::vector<G4LogicalVolume*>::const_iterator ite = fibre1LV.begin();
754  for (; ite != fibre1LV.end(); ++ite) if (lv == *ite) return true;
755  return false;
756 }
std::vector< G4LogicalVolume * > fibre1LV
Definition: HCalSD.h:101
double HCalSD::layerWeight ( int  det,
const G4ThreeVector &  pos,
int  depth,
int  lay 
)
private

Definition at line 1119 of file HCalSD.cc.

References DebugLog, TauDecayModes::dec, HcalNumberingFromDDD::HcalID::etaR, HcalNumberingFromDDD::HcalID::lay, layerWeights, modifyDepth(), numberingFromDDD, HcalTestNumbering::packHcalIndex(), HcalNumberingFromDDD::HcalID::phis, HcalNumberingFromDDD::HcalID::subdet, tmp, HcalNumberingFromDDD::unitID(), and HcalNumberingFromDDD::HcalID::zside.

Referenced by getEnergyDeposit().

1119  {
1120 
1121  double wt = 1.;
1122  if (numberingFromDDD) {
1123  //get the ID's as eta, phi, depth, ... indices
1125  depth, lay);
1126  modifyDepth(tmp);
1127  uint32_t id = HcalTestNumbering::packHcalIndex(tmp.subdet, tmp.zside, 1,
1128  tmp.etaR, tmp.phis,tmp.lay);
1129  std::map<uint32_t,double>::const_iterator ite = layerWeights.find(id);
1130  if (ite != layerWeights.end()) wt = ite->second;
1131 #ifdef DebugLog
1132  edm::LogInfo("HcalSim") << "HCalSD::layerWeight: ID " << std::hex << id
1133  << std::dec << " (" << tmp.subdet << "/"
1134  << tmp.zside << "/1/" << tmp.etaR << "/"
1135  << tmp.phis << "/" << tmp.lay << ") Weight " <<wt;
1136 #endif
1137  }
1138  return wt;
1139 }
#define DebugLog
void modifyDepth(HcalNumberingFromDDD::HcalID &id)
Definition: HCalSD.cc:1197
static uint32_t packHcalIndex(int det, int z, int depth, int eta, int phi, int lay)
HcalNumberingFromDDD * numberingFromDDD
Definition: HCalSD.h:82
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
std::map< uint32_t, double > layerWeights
Definition: HCalSD.h:102
HcalID unitID(int det, const CLHEP::Hep3Vector &pos, int depth, int lay=-1) const
void HCalSD::modifyDepth ( HcalNumberingFromDDD::HcalID id)
private

Definition at line 1197 of file HCalSD.cc.

References HLT_25ns10e33_v2_cff::depth, hcalConstants, and HcalDDDSimConstants::maxHFDepth().

Referenced by getHitFibreBundle(), getHitPMT(), layerWeight(), and setDetUnitId().

1197  {
1198  if (id.subdet == 4) {
1199  int ieta = (id.zside == 0) ? -id.etaR : id.etaR;
1200  if (hcalConstants->maxHFDepth(ieta,id.phis) > 2) {
1201  if (id.depth <= 2) {
1202  if (G4UniformRand() > 0.5) id.depth += 2;
1203  }
1204  }
1205  }
1206 }
int maxHFDepth(int ieta, int iphi) const
HcalDDDSimConstants * hcalConstants
Definition: HCalSD.h:81
void HCalSD::plotHF ( G4ThreeVector &  pos,
bool  emType 
)
private

Definition at line 1188 of file HCalSD.cc.

References funct::abs(), gpar, hzvem, and hzvhad.

Referenced by getFromLibrary(), and hitForFibre().

1188  {
1189  double zv = std::abs(hitPoint.z()) - gpar[4];
1190  if (emType) {
1191  if (hzvem != 0) hzvem->Fill(zv);
1192  } else {
1193  if (hzvhad != 0) hzvhad->Fill(zv);
1194  }
1195 }
std::vector< double > gpar
Definition: HCalSD.h:97
TH1F * hzvhad
Definition: HCalSD.h:103
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TH1F * hzvem
Definition: HCalSD.h:103
void HCalSD::plotProfile ( G4Step *  step,
const G4ThreeVector &  pos,
double  edep,
double  time,
int  id 
)
private

Definition at line 1141 of file HCalSD.cc.

References funct::abs(), HLT_25ns10e33_v2_cff::depth, dist_, newFWLiteAna::found, hit_, customizeTrackingMonitorSeedNumber::idx, cuy::ii, LogDebug, gen::n, SensitiveDetector::name, and time_.

Referenced by getFromLibrary(), getFromParam(), getHitFibreBundle(), getHitPMT(), hitForFibre(), and ProcessHits().

1142  {
1143 
1144  const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
1145  static G4String modName[8] = {"HEModule", "HVQF" , "HBModule", "MBAT",
1146  "MBBT" , "MBBTC", "MBBT_R1P", "MBBT_R1M"};
1147  G4ThreeVector local;
1148  bool found=false;
1149  double depth=-2000;
1150  int idx = 4;
1151  for (int n=0; n<touch->GetHistoryDepth(); ++n) {
1152  G4String name = touch->GetVolume(n)->GetName();
1153 #ifdef DebugLog
1154  LogDebug("HcalSim") << "plotProfile Depth " << n << " Name " << name;
1155 #endif
1156  for (unsigned int ii=0; ii<8; ++ii) {
1157  if (name == modName[ii]) {
1158  found = true;
1159  int dn = touch->GetHistoryDepth() - n;
1160  local = touch->GetHistory()->GetTransform(dn).TransformPoint(global);
1161  if (ii == 0) {depth = local.z() - 4006.5; idx = 1;}
1162  else if (ii == 1) {depth = local.z() + 825.0; idx = 3;}
1163  else if (ii == 2) {depth = local.x() - 1775.; idx = 0;}
1164  else {depth = local.y() + 15.; idx = 2;}
1165  break;
1166  }
1167  }
1168  if (found) break;
1169  }
1170  if (!found) depth = std::abs(global.z()) - 11500;
1171 #ifdef DebugLog
1172  LogDebug("HcalSim") << "plotProfile Found " << found << " Global " << global
1173  << " Local " << local << " depth " << depth << " ID "
1174  << id << " EDEP " << edep << " Time " << time;
1175 #endif
1176  if (hit_[idx] != 0) hit_[idx]->Fill(edep);
1177  if (time_[idx] != 0) time_[idx]->Fill(time,edep);
1178  if (dist_[idx] != 0) dist_[idx]->Fill(depth,edep);
1179  int jd = 2*idx + id - 7;
1180  if (jd >= 0 && jd < 4) {
1181  jd += 5;
1182  if (hit_[jd] != 0) hit_[jd]->Fill(edep);
1183  if (time_[jd] != 0) time_[jd]->Fill(time,edep);
1184  if (dist_[jd] != 0) dist_[jd]->Fill(depth,edep);
1185  }
1186 }
#define LogDebug(id)
TH1F * time_[9]
Definition: HCalSD.h:103
int ii
Definition: cuy.py:588
TH1F * hit_[9]
Definition: HCalSD.h:103
TH1F * dist_[9]
Definition: HCalSD.h:103
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
bool HCalSD::ProcessHits ( G4Step *  aStep,
G4TouchableHistory *   
)
virtual

Reimplemented from CaloSD.

Definition at line 372 of file HCalSD.cc.

References funct::abs(), CaloSD::createNewHit(), CaloSD::currentHit, HFDarkening::degradation(), deliveredLumi, HFDarkening::dose(), CaloSD::edepositEM, CaloSD::edepositHAD, getFromLibrary(), getFromParam(), getHitFibreBundle(), getHitPMT(), CaloSD::getNumberOfHits(), CaloSD::getStepInfo(), CaloSD::hitExists(), hitForFibre(), i, HFDarkening::int_lumi(), isItConicalBundle(), isItFibre(), isItHF(), isItPMT(), isItStraightBundle(), LogDebug, m_HFDarkening, mumPDG, mupPDG, SensitiveDetector::NaNTrap(), NULL, plotProfile(), alignCSCRings::r, showerBundle, showerPMT, useFibreBundle, useParam, usePMTHit, useShowerLibrary, histoStyle::weight, and z.

372  {
373 
374  NaNTrap( aStep ) ;
375 
376  if (aStep == NULL) {
377  return true;
378  } else {
379  G4LogicalVolume* lv =
380  aStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume();
381  G4String nameVolume = lv->GetName();
382  if (isItHF(aStep)) {
383  G4int parCode = aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
384  double weight(1.0);
385  if (m_HFDarkening != 0) {
386  G4ThreeVector hitPoint = aStep->GetPreStepPoint()->GetPosition();
387  double r = hitPoint.perp()/CLHEP::cm;
388  double z = std::abs(hitPoint.z())/CLHEP::cm;
389  float dose_acquired = 0.;
390  if (z>=1100 && z <= 1300) {
391  int hfZLayer = (int)((z - 1100)/20);
392  if (hfZLayer > 9) hfZLayer = 9;
393  float normalized_lumi = m_HFDarkening->int_lumi(deliveredLumi);
394  for (int i = hfZLayer; i <= 9; ++i) {
395  dose_acquired = m_HFDarkening->dose(i,r);
396  weight *= m_HFDarkening->degradation(normalized_lumi*dose_acquired);
397  }
398  }
399 #ifdef DebugLog
400  LogDebug("HcalSim") << "HCalSD: HFLumiDarkening at r = " << r
401  << ", z = " << z << " Dose " << dose_acquired
402  << " weight " << weight;
403 #endif
404  }
405  if (useParam) {
406 #ifdef DebugLog
407  LogDebug("HcalSim") << "HCalSD: " << getNumberOfHits()
408  << " hits from parametrization in " << nameVolume
409  << " for Track " << aStep->GetTrack()->GetTrackID()
410  <<" (" << aStep->GetTrack()->GetDefinition()->GetParticleName()
411  <<")";
412 #endif
413  getFromParam(aStep, weight);
414 #ifdef DebugLog
415  LogDebug("HcalSim") << "HCalSD: " << getNumberOfHits()
416  << " hits afterParamS*";
417 #endif
418  } else {
419  bool notaMuon = true;
420  if (parCode == mupPDG || parCode == mumPDG ) notaMuon = false;
421  if (useShowerLibrary && notaMuon) {
422 #ifdef DebugLog
423  LogDebug("HcalSim") << "HCalSD: Starts shower library from "
424  << nameVolume << " for Track "
425  << aStep->GetTrack()->GetTrackID() << " ("
426  << aStep->GetTrack()->GetDefinition()->GetParticleName() << ")";
427 #endif
428  getFromLibrary(aStep, weight);
429  } else if (isItFibre(lv)) {
430 #ifdef DebugLog
431  LogDebug("HcalSim") << "HCalSD: Hit at Fibre in " << nameVolume
432  << " for Track "
433  << aStep->GetTrack()->GetTrackID() <<" ("
434  << aStep->GetTrack()->GetDefinition()->GetParticleName() << ")";
435 #endif
436  hitForFibre(aStep, weight);
437  }
438  }
439  } else if (isItPMT(lv)) {
440 #ifdef DebugLog
441  LogDebug("HcalSim") << "HCalSD: Hit from PMT parametrization from "
442  << nameVolume << " for Track "
443  << aStep->GetTrack()->GetTrackID() << " ("
444  << aStep->GetTrack()->GetDefinition()->GetParticleName() << ")";
445 #endif
446  if (usePMTHit && showerPMT) getHitPMT(aStep);
447  } else if (isItStraightBundle(lv) || isItConicalBundle(lv)) {
448 #ifdef DebugLog
449  LogDebug("HcalSim") << "HCalSD: Hit from FibreBundle from "
450  << nameVolume << " for Track "
451  << aStep->GetTrack()->GetTrackID() << " ("
452  << aStep->GetTrack()->GetDefinition()->GetParticleName() << ")";
453 #endif
456  } else {
457 #ifdef DebugLog
458  LogDebug("HcalSim") << "HCalSD: Hit from standard path from "
459  << nameVolume << " for Track "
460  << aStep->GetTrack()->GetTrackID() << " ("
461  << aStep->GetTrack()->GetDefinition()->GetParticleName() << ")";
462 #endif
463  if (getStepInfo(aStep)) {
464 #ifdef plotDebug
465  if (edepositEM+edepositHAD > 0)
466  plotProfile(aStep, aStep->GetPreStepPoint()->GetPosition(),
467  edepositEM+edepositHAD,aStep->GetPostStepPoint()->GetGlobalTime(),0);
468 #endif
469  if (hitExists() == false && edepositEM+edepositHAD>0.) currentHit = createNewHit();
470  }
471  }
472  return true;
473  }
474 }
#define LogDebug(id)
float edepositEM
Definition: CaloSD.h:121
int i
Definition: DBlmapReader.cc:9
bool useParam
Definition: HCalSD.h:93
float int_lumi(float intlumi)
Definition: HFDarkening.cc:147
void hitForFibre(G4Step *step, double weight)
Definition: HCalSD.cc:850
void getFromParam(G4Step *step, double weight)
Definition: HCalSD.cc:902
bool isItStraightBundle(G4LogicalVolume *)
Definition: HCalSD.cc:752
bool useFibreBundle
Definition: HCalSD.h:91
double deliveredLumi
Definition: HCalSD.h:95
HFShowerFibreBundle * showerBundle
Definition: HCalSD.h:88
bool useShowerLibrary
Definition: HCalSD.h:93
#define NULL
Definition: scimark2.h:8
void getFromLibrary(G4Step *step, double weight)
Definition: HCalSD.cc:787
bool usePMTHit
Definition: HCalSD.h:91
bool isItHF(G4Step *)
Definition: HCalSD.cc:716
bool isItConicalBundle(G4LogicalVolume *)
Definition: HCalSD.cc:758
float edepositHAD
Definition: CaloSD.h:121
float degradation(float mrad)
Definition: HFDarkening.cc:143
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
void getHitPMT(G4Step *step)
Definition: HCalSD.cc:941
int getNumberOfHits()
Definition: CaloSD.cc:361
HFDarkening * m_HFDarkening
Definition: HCalSD.h:90
CaloG4Hit * currentHit
Definition: CaloSD.h:128
void plotProfile(G4Step *step, const G4ThreeVector &pos, double edep, double time, int id)
Definition: HCalSD.cc:1141
void NaNTrap(G4Step *step)
virtual G4bool getStepInfo(G4Step *aStep)
Definition: CaloSD.cc:250
bool isItPMT(G4LogicalVolume *)
Definition: HCalSD.cc:746
G4int mupPDG
Definition: HCalSD.h:96
void getHitFibreBundle(G4Step *step, bool type)
Definition: HCalSD.cc:1009
float dose(int layer, float radius)
Definition: HFDarkening.cc:92
G4bool hitExists()
Definition: CaloSD.cc:310
G4int mumPDG
Definition: HCalSD.h:96
HFShowerPMT * showerPMT
Definition: HCalSD.h:87
int weight
Definition: histoStyle.py:50
CaloG4Hit * createNewHit()
Definition: CaloSD.cc:363
bool isItFibre(G4LogicalVolume *)
Definition: HCalSD.cc:734
void HCalSD::readWeightFromFile ( std::string  fName)
private

Definition at line 1093 of file HCalSD.cc.

References TauDecayModes::dec, mps_splice::entry, MainPageGenerator::fName, recoMuon::in, timingPdfMaker::infile, layerWeights, HcalTestNumbering::packHcalIndex(), phi, useLayerWt, and ecaldqm::zside().

Referenced by HCalSD().

1093  {
1094 
1095  std::ifstream infile;
1096  int entry=0;
1097  infile.open(fName.c_str(), std::ios::in);
1098  if (infile) {
1099  int det, zside, etaR, phi, lay;
1100  double wt;
1101  while (infile >> det >> zside >> etaR >> phi >> lay >> wt) {
1102  uint32_t id = HcalTestNumbering::packHcalIndex(det,zside,1,etaR,phi,lay);
1103  layerWeights.insert(std::pair<uint32_t,double>(id,wt));
1104  ++entry;
1105 #ifdef DebugLog
1106  edm::LogInfo("HcalSim") << "HCalSD::readWeightFromFile:Entry " << entry
1107  << " ID " << std::hex << id << std::dec << " ("
1108  << det << "/" << zside << "/1/" << etaR << "/"
1109  << phi << "/" << lay << ") Weight " << wt;
1110 #endif
1111  }
1112  infile.close();
1113  }
1114  edm::LogInfo("HcalSim") << "HCalSD::readWeightFromFile: reads " << entry
1115  << " weights from " << fName;
1116  if (entry <= 0) useLayerWt = false;
1117 }
bool useLayerWt
Definition: HCalSD.h:91
int zside(DetId const &)
static uint32_t packHcalIndex(int det, int z, int depth, int eta, int phi, int lay)
list entry
Definition: mps_splice.py:62
std::map< uint32_t, double > layerWeights
Definition: HCalSD.h:102
uint32_t HCalSD::setDetUnitId ( G4Step *  step)
virtual

Implements CaloSD.

Definition at line 572 of file HCalSD.cc.

References HLT_25ns10e33_v2_cff::depth, and CaloSD::preStepPoint.

Referenced by getEnergyDeposit(), getFromLibrary(), getFromParam(), and hitForFibre().

572  {
573 
574  G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
575  const G4VTouchable* touch = preStepPoint->GetTouchable();
576  G4ThreeVector hitPoint = preStepPoint->GetPosition();
577 
578  int depth = (touch->GetReplicaNumber(0))%10 + 1;
579  int lay = (touch->GetReplicaNumber(0)/10)%100 + 1;
580  int det = (touch->GetReplicaNumber(1))/1000;
581 
582  return setDetUnitId (det, hitPoint, depth, lay);
583 }
virtual uint32_t setDetUnitId(G4Step *step)
Definition: HCalSD.cc:572
G4StepPoint * preStepPoint
Definition: CaloSD.h:120
uint32_t HCalSD::setDetUnitId ( int  det,
const G4ThreeVector &  pos,
int  depth,
int  lay = 1 
)
private

Definition at line 659 of file HCalSD.cc.

References HcalNumberingScheme::getUnitID(), modifyDepth(), numberingFromDDD, numberingScheme, tmp, and HcalNumberingFromDDD::unitID().

659  {
660  uint32_t id = 0;
661  if (numberingFromDDD) {
662  //get the ID's as eta, phi, depth, ... indices
664  modifyDepth(tmp);
665  //get the ID
666  if (numberingScheme) id = numberingScheme->getUnitID(tmp);
667  }
668  return id;
669 }
virtual uint32_t getUnitID(const HcalNumberingFromDDD::HcalID &id)
void modifyDepth(HcalNumberingFromDDD::HcalID &id)
Definition: HCalSD.cc:1197
HcalNumberingScheme * numberingScheme
Definition: HCalSD.h:83
HcalNumberingFromDDD * numberingFromDDD
Definition: HCalSD.h:82
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
HcalID unitID(int det, const CLHEP::Hep3Vector &pos, int depth, int lay=-1) const
void HCalSD::setNumberingScheme ( HcalNumberingScheme scheme)

Definition at line 585 of file HCalSD.cc.

References numberingScheme.

Referenced by HCalSD(), HcalTestAnalysis::update(), SimG4HcalValidation::update(), and HcalTB04Analysis::update().

585  {
586  if (scheme != 0) {
587  edm::LogInfo("HcalSim") << "HCalSD: updates numbering scheme for " << GetName();
588  if (numberingScheme) delete numberingScheme;
589  numberingScheme = scheme;
590  }
591 }
HcalNumberingScheme * numberingScheme
Definition: HCalSD.h:83
int HCalSD::setTrackID ( G4Step *  step)
private

Definition at line 1073 of file HCalSD.cc.

References TrackInformation::getIDonCaloSurface(), CaloSD::preStepPoint, CaloSD::previousID, CaloSD::resetForNewPrimary(), CaloSD::theTrack, and CaloHitID::trackID().

Referenced by getFromLibrary(), getFromParam(), and hitForFibre().

1073  {
1074  theTrack = aStep->GetTrack();
1075 
1076  double etrack = preStepPoint->GetKineticEnergy();
1077  TrackInformation * trkInfo = (TrackInformation *)(theTrack->GetUserInformation());
1078  int primaryID = trkInfo->getIDonCaloSurface();
1079  if (primaryID == 0) {
1080 #ifdef DebugLog
1081  edm::LogInfo("HcalSim") << "HCalSD: Problem with primaryID **** set by "
1082  << "force to TkID **** " <<theTrack->GetTrackID();
1083 #endif
1084  primaryID = theTrack->GetTrackID();
1085  }
1086 
1087  if (primaryID != previousID.trackID())
1088  resetForNewPrimary(preStepPoint->GetPosition(), etrack);
1089 
1090  return primaryID;
1091 }
int getIDonCaloSurface() const
void resetForNewPrimary(const G4ThreeVector &, double)
Definition: CaloSD.cc:454
int trackID() const
Definition: CaloHitID.h:25
CaloHitID previousID
Definition: CaloSD.h:117
G4Track * theTrack
Definition: CaloSD.h:118
G4StepPoint * preStepPoint
Definition: CaloSD.h:120
void HCalSD::update ( const BeginOfJob )
protectedvirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfJob * >.

Definition at line 593 of file HCalSD.cc.

References Exception, edm::EventSetup::get(), HcalDDDSimConstants::getGparHF(), HcalDDDSimConstants::getLayer0Wt(), HcalDDDSimConstants::getMaxDepth(), gpar, hcalConstants, layer0wt, and numberingFromDDD.

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), MatrixUtil.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

593  {
594 
595  const edm::EventSetup* es = (*job)();
597  es->get<HcalSimNumberingRecord>().get(hdc);
598  if (hdc.isValid()) {
599  hcalConstants = (HcalDDDSimConstants*)(&(*hdc));
600  } else {
601  edm::LogError("HcalSim") << "HCalSD : Cannot find HcalDDDSimConstant";
602  throw cms::Exception("Unknown", "HCalSD") << "Cannot find HcalDDDSimConstant" << "\n";
603  }
604 
606 
607  edm::LogInfo("HcalSim") << "Maximum depth for HF " << hcalConstants->getMaxDepth(2);
608 
609  //Special Geometry parameters
611  edm::LogInfo("HcalSim") << "HCalSD: " << gpar.size()<< " gpar (cm)";
612  for (unsigned int ig=0; ig<gpar.size(); ig++)
613  edm::LogInfo("HcalSim") << "HCalSD: gpar[" << ig << "] = "
614  << gpar[ig]/cm << " cm";
615 
616  //Layer0 Weight
618  edm::LogInfo("HcalSim") << "HCalSD: " << layer0wt.size() << " Layer0Wt";
619  for (unsigned int it=0; it<layer0wt.size(); ++it)
620  edm::LogInfo("HcalSim") << "HCalSD: [" << it << "] " << layer0wt[it];
621 
622 }
std::vector< double > layer0wt
Definition: HCalSD.h:97
std::vector< double > gpar
Definition: HCalSD.h:97
int getMaxDepth(const int type) const
const std::vector< double > & getLayer0Wt() const
const std::vector< double > & getGparHF() const
const T & get() const
Definition: EventSetup.h:56
HcalNumberingFromDDD * numberingFromDDD
Definition: HCalSD.h:82
HcalDDDSimConstants * hcalConstants
Definition: HCalSD.h:81

Member Data Documentation

bool HCalSD::applyFidCut
private

Definition at line 93 of file HCalSD.h.

Referenced by HCalSD(), and isItinFidVolume().

double HCalSD::betaThr
private

Definition at line 92 of file HCalSD.h.

Referenced by HCalSD().

double HCalSD::birk1
private

Definition at line 92 of file HCalSD.h.

Referenced by getEnergyDeposit(), and HCalSD().

double HCalSD::birk2
private

Definition at line 92 of file HCalSD.h.

Referenced by getEnergyDeposit(), and HCalSD().

double HCalSD::birk3
private

Definition at line 92 of file HCalSD.h.

Referenced by getEnergyDeposit(), and HCalSD().

double HCalSD::deliveredLumi
private

Definition at line 95 of file HCalSD.h.

Referenced by getEnergyDeposit(), HCalSD(), and ProcessHits().

TH1F * HCalSD::dist_[9]
private

Definition at line 103 of file HCalSD.h.

Referenced by HCalSD(), and plotProfile().

double HCalSD::eminHitHB
private

Definition at line 94 of file HCalSD.h.

Referenced by filterHit(), and HCalSD().

double HCalSD::eminHitHE
private

Definition at line 94 of file HCalSD.h.

Referenced by filterHit(), and HCalSD().

double HCalSD::eminHitHF
private

Definition at line 94 of file HCalSD.h.

Referenced by filterHit(), and HCalSD().

double HCalSD::eminHitHO
private

Definition at line 94 of file HCalSD.h.

Referenced by filterHit(), and HCalSD().

std::vector<G4LogicalVolume*> HCalSD::fibre1LV
private

Definition at line 101 of file HCalSD.h.

Referenced by HCalSD(), and isItStraightBundle().

std::vector<G4LogicalVolume*> HCalSD::fibre2LV
private

Definition at line 101 of file HCalSD.h.

Referenced by HCalSD(), and isItConicalBundle().

std::vector<G4LogicalVolume*> HCalSD::fibreLV
private

Definition at line 101 of file HCalSD.h.

Referenced by HCalSD(), and isItFibre().

std::vector<G4String> HCalSD::fibreNames
private

Definition at line 99 of file HCalSD.h.

Referenced by HCalSD(), and isItFibre().

std::vector<double> HCalSD::gpar
private

Definition at line 97 of file HCalSD.h.

Referenced by plotHF(), and update().

HcalDDDSimConstants* HCalSD::hcalConstants
private

Definition at line 81 of file HCalSD.h.

Referenced by initRun(), modifyDepth(), and update().

std::vector<int> HCalSD::hfLevels
private

Definition at line 98 of file HCalSD.h.

Referenced by HCalSD(), and isItHF().

std::vector<G4LogicalVolume*> HCalSD::hfLV
private

Definition at line 101 of file HCalSD.h.

Referenced by HCalSD(), and isItHF().

std::vector<G4String> HCalSD::hfNames
private

Definition at line 99 of file HCalSD.h.

Referenced by HCalSD(), and isItHF().

HFShower* HCalSD::hfshower
private

Definition at line 85 of file HCalSD.h.

Referenced by HCalSD(), hitForFibre(), initRun(), and ~HCalSD().

TH1F* HCalSD::hit_[9]
private

Definition at line 103 of file HCalSD.h.

Referenced by HCalSD(), and plotProfile().

TH1F * HCalSD::hzvem
private

Definition at line 103 of file HCalSD.h.

Referenced by HCalSD(), and plotHF().

TH1F * HCalSD::hzvhad
private

Definition at line 103 of file HCalSD.h.

Referenced by HCalSD(), and plotHF().

std::vector<double> HCalSD::layer0wt
private

Definition at line 97 of file HCalSD.h.

Referenced by getEnergyDeposit(), and update().

std::map<uint32_t,double> HCalSD::layerWeights
private

Definition at line 102 of file HCalSD.h.

Referenced by layerWeight(), and readWeightFromFile().

HEDarkening* HCalSD::m_HEDarkening
private

Definition at line 89 of file HCalSD.h.

Referenced by getEnergyDeposit(), HCalSD(), and ~HCalSD().

HFDarkening* HCalSD::m_HFDarkening
private

Definition at line 90 of file HCalSD.h.

Referenced by HCalSD(), ProcessHits(), and ~HCalSD().

std::vector<G4Material*> HCalSD::materials
private

Definition at line 100 of file HCalSD.h.

Referenced by HCalSD(), and isItScintillator().

std::vector<G4String> HCalSD::matNames
private

Definition at line 99 of file HCalSD.h.

Referenced by HCalSD().

G4int HCalSD::mumPDG
private

Definition at line 96 of file HCalSD.h.

Referenced by HCalSD(), initRun(), and ProcessHits().

G4int HCalSD::mupPDG
private

Definition at line 96 of file HCalSD.h.

Referenced by HCalSD(), initRun(), and ProcessHits().

HcalNumberingFromDDD* HCalSD::numberingFromDDD
private

Definition at line 82 of file HCalSD.h.

Referenced by getHitFibreBundle(), getHitPMT(), layerWeight(), setDetUnitId(), update(), and ~HCalSD().

HcalNumberingScheme* HCalSD::numberingScheme
private

Definition at line 83 of file HCalSD.h.

Referenced by getHitFibreBundle(), getHitPMT(), setDetUnitId(), setNumberingScheme(), and ~HCalSD().

std::vector<G4LogicalVolume*> HCalSD::pmtLV
private

Definition at line 101 of file HCalSD.h.

Referenced by HCalSD(), and isItPMT().

HFShowerFibreBundle* HCalSD::showerBundle
private

Definition at line 88 of file HCalSD.h.

Referenced by getHitFibreBundle(), HCalSD(), initRun(), ProcessHits(), and ~HCalSD().

HFShowerLibrary* HCalSD::showerLibrary
private

Definition at line 84 of file HCalSD.h.

Referenced by getFromLibrary(), HCalSD(), initRun(), and ~HCalSD().

HFShowerParam* HCalSD::showerParam
private

Definition at line 86 of file HCalSD.h.

Referenced by getFromParam(), HCalSD(), initRun(), and ~HCalSD().

HFShowerPMT* HCalSD::showerPMT
private

Definition at line 87 of file HCalSD.h.

Referenced by getHitPMT(), HCalSD(), initRun(), ProcessHits(), and ~HCalSD().

bool HCalSD::testNumber
private

Definition at line 91 of file HCalSD.h.

Referenced by getEnergyDeposit(), and HCalSD().

TH1F * HCalSD::time_[9]
private

Definition at line 103 of file HCalSD.h.

Referenced by HCalSD(), and plotProfile().

bool HCalSD::useBirk
private

Definition at line 91 of file HCalSD.h.

Referenced by getEnergyDeposit(), and HCalSD().

bool HCalSD::useFibreBundle
private

Definition at line 91 of file HCalSD.h.

Referenced by HCalSD(), and ProcessHits().

bool HCalSD::useHF
private

Definition at line 93 of file HCalSD.h.

Referenced by HCalSD().

bool HCalSD::useLayerWt
private

Definition at line 91 of file HCalSD.h.

Referenced by getEnergyDeposit(), HCalSD(), and readWeightFromFile().

bool HCalSD::useParam
private

Definition at line 93 of file HCalSD.h.

Referenced by HCalSD(), and ProcessHits().

bool HCalSD::usePMTHit
private

Definition at line 91 of file HCalSD.h.

Referenced by HCalSD(), and ProcessHits().

bool HCalSD::useShowerLibrary
private

Definition at line 93 of file HCalSD.h.

Referenced by HCalSD(), and ProcessHits().