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 maxDepthHF
 
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_25ns14e33_v1_cff::labels, testEve_cfg::level, cmsBatch::log, LogDebug, DDFilteredView::logicalPart(), m_HEDarkening, m_HFDarkening, TFileDirectory::make(), DDLogicalPart::material(), materials, matNames, maxDepthHF, 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  maxDepthHF = 2;
313 
314  if (useLayerWt) readWeightFromFile(file);
315 
316  for (int i=0; i<9; ++i) hit_[i] = time_[i]= dist_[i] = 0;
317  hzvem = hzvhad = 0;
318 
319  if (ageingFlagHE) m_HEDarkening = new HEDarkening();
320  if (ageingFlagHF) m_HFDarkening = new HFDarkening();
321 #ifdef plotDebug
323 
324  if ( tfile.isAvailable() ) {
325  static const char * const labels[] = {"HB", "HE", "HO", "HF Absorber", "HF PMT",
326  "HF Absorber Long", "HF Absorber Short",
327  "HF PMT Long", "HF PMT Short"};
328  TFileDirectory hcDir = tfile->mkdir("ProfileFromHCalSD");
329  char name[20], title[60];
330  for (int i=0; i<9; ++i) {
331  sprintf (title, "Hit energy in %s", labels[i]);
332  sprintf (name, "HCalSDHit%d", i);
333  hit_[i] = hcDir.make<TH1F>(name, title, 2000, 0., 2000.);
334  sprintf (title, "Energy (MeV)");
335  hit_[i]->GetXaxis()->SetTitle(title);
336  hit_[i]->GetYaxis()->SetTitle("Hits");
337  sprintf (title, "Time of the hit in %s", labels[i]);
338  sprintf (name, "HCalSDTime%d", i);
339  time_[i] = hcDir.make<TH1F>(name, title, 2000, 0., 2000.);
340  sprintf (title, "Time (ns)");
341  time_[i]->GetXaxis()->SetTitle(title);
342  time_[i]->GetYaxis()->SetTitle("Hits");
343  sprintf (title, "Longitudinal profile in %s", labels[i]);
344  sprintf (name, "HCalSDDist%d", i);
345  dist_[i] = hcDir.make<TH1F>(name, title, 2000, 0., 2000.);
346  sprintf (title, "Distance (mm)");
347  dist_[i]->GetXaxis()->SetTitle(title);
348  dist_[i]->GetYaxis()->SetTitle("Hits");
349  }
350  if (useHF && (!useParam)) {
351  hzvem = hcDir.make<TH1F>("hzvem", "Longitudinal Profile (EM Part)",330,0.0,1650.0);
352  hzvem->GetXaxis()->SetTitle("Longitudinal Profile (EM Part)");
353  hzvhad = hcDir.make<TH1F>("hzvhad","Longitudinal Profile (Had Part)",330,0.0,1650.0);
354  hzvhad->GetXaxis()->SetTitle("Longitudinal Profile (Hadronic Part)");
355  }
356  }
357 #endif
358 }
#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:673
double birk2
Definition: HCalSD.h:92
bool usePMTHit
Definition: HCalSD.h:91
void setNumberingScheme(HcalNumberingScheme *)
Definition: HCalSD.cc:586
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:718
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
G4int maxDepthHF
Definition: HCalSD.h:96
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:1095
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:736
bool useHF
Definition: HCalSD.h:93
tuple log
Definition: cmsBatch.py:341
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 360 of file HCalSD.cc.

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

360  {
361 
363  if (numberingScheme) delete numberingScheme;
364  if (showerLibrary) delete showerLibrary;
365  if (hfshower) delete hfshower;
366  if (showerParam) delete showerParam;
367  if (showerPMT) delete showerPMT;
368  if (showerBundle) delete showerBundle;
369  if (m_HEDarkening) delete m_HEDarkening;
370  if (m_HFDarkening) delete m_HFDarkening;
371 }
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 642 of file HCalSD.cc.

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

642  {
643  double threshold=0;
644  DetId theId(aHit->getUnitID());
645  switch (theId.subdetId()) {
646  case HcalBarrel:
647  threshold = eminHitHB; break;
648  case HcalEndcap:
649  threshold = eminHitHE; break;
650  case HcalOuter:
651  threshold = eminHitHO; break;
652  case HcalForward:
653  threshold = eminHitHF; break;
654  default:
655  break;
656  }
657  return ((time <= tmaxHit) && (aHit->getEnergyDeposit() > threshold));
658 }
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 673 of file HCalSD.cc.

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

Referenced by HCalSD().

674  {
675 #ifdef DebugLog
676  LogDebug("HcalSim") << "HCalSD:getDDDArray called for " << str;
677 #endif
678  DDValue value(str);
679  if (DDfetch(&sv,value)) {
680 #ifdef DebugLog
681  LogDebug("HcalSim") << value;
682 #endif
683  const std::vector<double> & fvec = value.doubles();
684  int nval = fvec.size();
685  if (nval < 1) {
686  edm::LogError("HcalSim") << "HCalSD : # of " << str << " bins " << nval
687  << " < 2 ==> illegal";
688  throw cms::Exception("Unknown", "HCalSD") << "nval < 2 for array " << str << "\n";
689  }
690 
691  return fvec;
692  } else {
693  edm::LogError("HcalSim") << "HCalSD : cannot get array " << str;
694  throw cms::Exception("Unknown", "HCalSD") << "cannot get array " << str << "\n";
695  }
696 }
#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 477 of file HCalSD.cc.

References birk1, birk2, birk3, HEDarkening::degradation(), deliveredLumi, HLT_25ns14e33_v1_cff::depth, cond::rpcobgas::detid, 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, puppiForMET_cff::weight, and z.

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

Definition at line 789 of file HCalSD.cc.

References CaloSD::checkHit(), CaloSD::createNewHit(), CaloSD::currentHit, CaloSD::currentID, HLT_25ns14e33_v1_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, cond::rpcobgas::time, and CaloSD::updateHit().

Referenced by ProcessHits().

789  {
790  preStepPoint = aStep->GetPreStepPoint();
791  theTrack = aStep->GetTrack();
792  int det = 5;
793  bool ok;
794 
795  std::vector<HFShowerLibrary::Hit> hits = showerLibrary->getHits(aStep, ok, weight, false);
796 
797  double etrack = preStepPoint->GetKineticEnergy();
798  int primaryID = setTrackID(aStep);
799 
800  // Reset entry point for new primary
801  posGlobal = preStepPoint->GetPosition();
802  resetForNewPrimary(posGlobal, etrack);
803 
804  G4int particleCode = theTrack->GetDefinition()->GetPDGEncoding();
805  if (particleCode==emPDG || particleCode==epPDG || particleCode==gammaPDG) {
806  edepositEM = 1.*GeV;
807  edepositHAD = 0.;
808  } else {
809  edepositEM = 0.;
810  edepositHAD = 1.*GeV;
811  }
812 #ifdef DebugLog
813  edm::LogInfo("HcalSim") << "HCalSD::getFromLibrary " <<hits.size()
814  << " hits for " << GetName() << " of " << primaryID
815  << " with " << theTrack->GetDefinition()->GetParticleName()
816  << " of " << preStepPoint->GetKineticEnergy()/GeV << " GeV";
817 #endif
818  for (unsigned int i=0; i<hits.size(); ++i) {
819  G4ThreeVector hitPoint = hits[i].position;
820  if (isItinFidVolume (hitPoint)) {
821  int depth = hits[i].depth;
822  double time = hits[i].time;
823  unsigned int unitID = setDetUnitId(det, hitPoint, depth);
824  currentID.setID(unitID, time, primaryID, 0);
825 #ifdef plotDebug
826  plotProfile(aStep, hitPoint, 1.0*GeV, time, depth);
827  bool emType = false;
828  if (particleCode==emPDG || particleCode==epPDG || particleCode==gammaPDG)
829  emType = true;
830  plotHF(hitPoint,emType);
831 #endif
832 
833  // check if it is in the same unit and timeslice as the previous one
834  if (currentID == previousID) {
836  } else {
837  if (!checkHit()) currentHit = createNewHit();
838  }
839  }
840  }
841 
842  //Now kill the current track
843  if (ok) {
844  theTrack->SetTrackStatus(fStopAndKill);
845  G4TrackVector tv = *(aStep->GetSecondary());
846  for (unsigned int kk=0; kk<tv.size(); ++kk)
847  if (tv[kk]->GetVolume() == preStepPoint->GetPhysicalVolume())
848  tv[kk]->SetTrackStatus(fStopAndKill);
849  }
850 }
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:772
std::vector< Hit > getHits(G4Step *aStep, bool &ok, double weight, bool onlyLong=false)
virtual uint32_t setDetUnitId(G4Step *step)
Definition: HCalSD.cc:573
int setTrackID(G4Step *step)
Definition: HCalSD.cc:1075
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:1190
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:1143
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
HFShowerLibrary * showerLibrary
Definition: HCalSD.h:84
CaloG4Hit * createNewHit()
Definition: CaloSD.cc:363
void HCalSD::getFromParam ( G4Step *  step,
double  weight 
)
private

Definition at line 904 of file HCalSD.cc.

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

Referenced by ProcessHits().

904  {
905  std::vector<HFShowerParam::Hit> hits = showerParam->getHits(aStep, weight);
906  int nHit = static_cast<int>(hits.size());
907 
908  if (nHit > 0) {
909  preStepPoint = aStep->GetPreStepPoint();
910  int primaryID = setTrackID(aStep);
911 
912  int det = 5;
913 #ifdef DebugLog
914  edm::LogInfo("HcalSim") << "HCalSD::getFromParam " << nHit << " hits for "
915  << GetName() << " of " << primaryID << " with "
916  << aStep->GetTrack()->GetDefinition()->GetParticleName()
917  << " of " << preStepPoint->GetKineticEnergy()/GeV
918  << " GeV in detector type " << det;
919 #endif
920  for (int i = 0; i<nHit; ++i) {
921  G4ThreeVector hitPoint = hits[i].position;
922  int depth = hits[i].depth;
923  double time = hits[i].time;
924  unsigned int unitID = setDetUnitId(det, hitPoint, depth);
925  currentID.setID(unitID, time, primaryID, 0);
926  edepositEM = hits[i].edep*GeV;
927  edepositHAD = 0.;
928 #ifdef plotDebug
929  plotProfile(aStep, hitPoint, edepositEM, time, depth);
930 #endif
931 
932  // check if it is in the same unit and timeslice as the previous one
933  if (currentID == previousID) {
935  } else {
936  posGlobal = preStepPoint->GetPosition();
937  if (!checkHit()) currentHit = createNewHit();
938  }
939  }
940  }
941 }
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:573
int setTrackID(G4Step *step)
Definition: HCalSD.cc:1075
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:1143
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)
CaloG4Hit * createNewHit()
Definition: CaloSD.cc:363
void HCalSD::getHitFibreBundle ( G4Step *  step,
bool  type 
)
private

Definition at line 1011 of file HCalSD.cc.

References beta, CaloSD::checkHit(), CaloSD::createNewHit(), CaloSD::currentHit, CaloSD::currentID, TauDecayModes::dec, HLT_25ns14e33_v1_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, cond::rpcobgas::time, tmp, HcalNumberingFromDDD::unitID(), and CaloSD::updateHit().

Referenced by ProcessHits().

1011  {
1012  preStepPoint = aStep->GetPreStepPoint();
1013  theTrack = aStep->GetTrack();
1014  double edep = showerBundle->getHits(aStep, type);
1015 
1016  if (edep >= 0) {
1017  double etrack = preStepPoint->GetKineticEnergy();
1018  int primaryID = 0;
1019  if (etrack >= energyCut) {
1020  primaryID = theTrack->GetTrackID();
1021  } else {
1022  primaryID = theTrack->GetParentID();
1023  if (primaryID == 0) primaryID = theTrack->GetTrackID();
1024  }
1025  // Reset entry point for new primary
1026  posGlobal = preStepPoint->GetPosition();
1027  resetForNewPrimary(posGlobal, etrack);
1028 
1029  //
1030  int det = static_cast<int>(HcalForward);
1031  G4ThreeVector hitPoint = preStepPoint->GetPosition();
1032  double rr = (hitPoint.x()*hitPoint.x() + hitPoint.y()*hitPoint.y());
1033  double phi = (rr == 0. ? 0. :atan2(hitPoint.y(),hitPoint.x()));
1034  double etaR = showerBundle->getRadius();
1035  int depth = 1;
1036  if (etaR < 0) {
1037  depth = 2;
1038  etaR =-etaR;
1039  }
1040  if (hitPoint.z() < 0) etaR =-etaR;
1041 #ifdef DebugLog
1042  LogDebug("HcalSim") << "HCalSD::Hit for Detector " << det << " etaR "
1043  << etaR << " phi " << phi/deg << " depth " <<depth;
1044 #endif
1045  double time = (aStep->GetPostStepPoint()->GetGlobalTime());
1046  uint32_t unitID = 0;
1047  if (numberingFromDDD) {
1048  HcalNumberingFromDDD::HcalID tmp = numberingFromDDD->unitID(det,etaR,phi,depth,1);
1049  modifyDepth(tmp);
1050  if (numberingScheme) unitID = numberingScheme->getUnitID(tmp);
1051  }
1052  if (type) currentID.setID(unitID, time, primaryID, 3);
1053  else currentID.setID(unitID, time, primaryID, 2);
1054 
1055  edepositHAD = aStep->GetTotalEnergyDeposit();
1056  edepositEM =-edepositHAD + (edep*GeV);
1057 #ifdef plotDebug
1058  plotProfile(aStep, hitPoint, edep*GeV, time, depth);
1059 #endif
1060 #ifdef DebugLog
1061  double beta = preStepPoint->GetBeta();
1062  LogDebug("HcalSim") << "HCalSD::getHitFibreBundle 1 hit for " << GetName()
1063  << " of " << primaryID << " with "
1064  << theTrack->GetDefinition()->GetParticleName()
1065  << " of " << preStepPoint->GetKineticEnergy()/GeV
1066  << " GeV with velocity " << beta << " UnitID "
1067  << std::hex << unitID << std::dec;
1068 #endif
1069  // check if it is in the same unit and timeslice as the previous one
1071  else if (!checkHit()) currentHit = createNewHit();
1072  } // non-zero energy deposit
1073 }
#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:1199
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:1143
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 943 of file HCalSD.cc.

References beta, CaloSD::checkHit(), CaloSD::createNewHit(), CaloSD::currentHit, CaloSD::currentID, TauDecayModes::dec, HLT_25ns14e33_v1_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, cond::rpcobgas::time, tmp, HcalNumberingFromDDD::unitID(), and CaloSD::updateHit().

Referenced by ProcessHits().

943  {
944 
945  preStepPoint = aStep->GetPreStepPoint();
946  theTrack = aStep->GetTrack();
947  double edep = showerPMT->getHits(aStep);
948 
949  if (edep >= 0) {
950  double etrack = preStepPoint->GetKineticEnergy();
951  int primaryID = 0;
952  if (etrack >= energyCut) {
953  primaryID = theTrack->GetTrackID();
954  } else {
955  primaryID = theTrack->GetParentID();
956  if (primaryID == 0) primaryID = theTrack->GetTrackID();
957  }
958  // Reset entry point for new primary
959  posGlobal = preStepPoint->GetPosition();
960  resetForNewPrimary(posGlobal, etrack);
961 
962  //
963  int det = static_cast<int>(HcalForward);
964  G4ThreeVector hitPoint = preStepPoint->GetPosition();
965  double rr = (hitPoint.x()*hitPoint.x() + hitPoint.y()*hitPoint.y());
966  double phi = (rr == 0. ? 0. :atan2(hitPoint.y(),hitPoint.x()));
967  double etaR = showerPMT->getRadius();
968  int depth = 1;
969  if (etaR < 0) {
970  depth = 2;
971  etaR =-etaR;
972  }
973  if (hitPoint.z() < 0) etaR =-etaR;
974 #ifdef DebugLog
975  edm::LogInfo("HcalSim") << "HCalSD::Hit for Detector " << det << " etaR "
976  << etaR << " phi " << phi/deg << " depth " <<depth;
977 #endif
978  double time = (aStep->GetPostStepPoint()->GetGlobalTime());
979  uint32_t unitID = 0;
980  if (numberingFromDDD) {
982  depth,1);
983  modifyDepth(tmp);
984  if (numberingScheme) unitID = numberingScheme->getUnitID(tmp);
985  }
986  currentID.setID(unitID, time, primaryID, 1);
987 
988  edepositHAD = aStep->GetTotalEnergyDeposit();
989  edepositEM =-edepositHAD + (edep*GeV);
990 #ifdef plotDebug
991  plotProfile(aStep, hitPoint, edep*GeV, time, depth);
992 #endif
993 #ifdef DebugLog
994  double beta = preStepPoint->GetBeta();
995  LogDebug("HcalSim") << "HCalSD::getHitPMT 1 hit for " << GetName()
996  << " of " << primaryID << " with "
997  << theTrack->GetDefinition()->GetParticleName()
998  << " of " << preStepPoint->GetKineticEnergy()/GeV
999  << " GeV with velocity " << beta << " UnitID "
1000  << std::hex << unitID << std::dec;
1001 #endif
1002  // check if it is in the same unit and timeslice as the previous one
1003  if (currentID == previousID) {
1005  } else {
1006  if (!checkHit()) currentHit = createNewHit();
1007  }
1008  }
1009 }
#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:1199
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:1143
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 698 of file HCalSD.cc.

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

698  {
699 
700  std::vector<G4String> tmp;
701  bool dodet = fv.firstChild();
702  while (dodet) {
703  const DDLogicalPart & log = fv.logicalPart();
704  bool ok = true;
705 
706  for (unsigned int i=0; i<tmp.size(); ++i) {
707  if (!strcmp(tmp[i].c_str(), log.name().name().c_str())) {
708  ok = false;
709  break;
710  }
711  }
712  if (ok) tmp.push_back(log.name().name());
713  dodet = fv.next();
714  }
715  return tmp;
716 }
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
tuple log
Definition: cmsBatch.py:341
void HCalSD::hitForFibre ( G4Step *  step,
double  weight 
)
private

Definition at line 852 of file HCalSD.cc.

References CaloSD::checkHit(), CaloSD::createNewHit(), CaloSD::currentHit, CaloSD::currentID, HLT_25ns14e33_v1_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, cond::rpcobgas::time, and CaloSD::updateHit().

Referenced by ProcessHits().

852  { // if not ParamShower
853 
854  preStepPoint = aStep->GetPreStepPoint();
855  theTrack = aStep->GetTrack();
856  int primaryID = setTrackID(aStep);
857 
858  int det = 5;
859  std::vector<HFShower::Hit> hits = hfshower->getHits(aStep, weight);
860 
861  G4int particleCode = theTrack->GetDefinition()->GetPDGEncoding();
862  if (particleCode==emPDG || particleCode==epPDG || particleCode==gammaPDG) {
863  edepositEM = 1.*GeV;
864  edepositHAD = 0.;
865  } else {
866  edepositEM = 0.;
867  edepositHAD = 1.*GeV;
868  }
869 
870 #ifdef DebugLog
871  edm::LogInfo("HcalSim") << "HCalSD::hitForFibre " << hits.size()
872  << " hits for " << GetName() << " of " << primaryID
873  << " with " << theTrack->GetDefinition()->GetParticleName()
874  << " of " << preStepPoint->GetKineticEnergy()/GeV
875  << " GeV in detector type " << det;
876 #endif
877  if (hits.size() > 0) {
878  for (unsigned int i=0; i<hits.size(); ++i) {
879  G4ThreeVector hitPoint = hits[i].position;
880  if (isItinFidVolume (hitPoint)) {
881  int depth = hits[i].depth;
882  double time = hits[i].time;
883  unsigned int unitID = setDetUnitId(det, hitPoint, depth);
884  currentID.setID(unitID, time, primaryID, 0);
885 #ifdef plotDebug
886  plotProfile(aStep, hitPoint, edepositEM, time, depth);
887  bool emType = false;
888  if (particleCode==emPDG || particleCode==epPDG || particleCode==gammaPDG)
889  emType = true;
890  plotHF(hitPoint,emType);
891 #endif
892  // check if it is in the same unit and timeslice as the previous one
893  if (currentID == previousID) {
895  } else {
896  posGlobal = preStepPoint->GetPosition();
897  if (!checkHit()) currentHit = createNewHit();
898  }
899  }
900  }
901  }
902 }
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:772
virtual uint32_t setDetUnitId(G4Step *step)
Definition: HCalSD.cc:573
int setTrackID(G4Step *step)
Definition: HCalSD.cc:1075
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:1190
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:1143
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
CaloG4Hit * createNewHit()
Definition: CaloSD.cc:363
void HCalSD::initRun ( void  )
protectedvirtual

Reimplemented from CaloSD.

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

626  {
627  G4ParticleTable * theParticleTable = G4ParticleTable::GetParticleTable();
628  G4String particleName;
629  mumPDG = theParticleTable->FindParticle(particleName="mu-")->GetPDGEncoding();
630  mupPDG = theParticleTable->FindParticle(particleName="mu+")->GetPDGEncoding();
631 #ifdef DebugLog
632  LogDebug("HcalSim") << "HCalSD: Particle code for mu- = " << mumPDG
633  << " for mu+ = " << mupPDG;
634 #endif
635  if (showerLibrary) showerLibrary->initRun(theParticleTable,hcalConstants);
636  if (showerParam) showerParam->initRun(theParticleTable,hcalConstants);
637  if (hfshower) hfshower->initRun(theParticleTable,hcalConstants);
638  if (showerPMT) showerPMT->initRun(theParticleTable,hcalConstants);
639  if (showerBundle) showerBundle->initRun(theParticleTable,hcalConstants);
640 }
#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 760 of file HCalSD.cc.

References fibre2LV.

Referenced by ProcessHits().

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

Definition at line 736 of file HCalSD.cc.

References fibreLV.

Referenced by HCalSD(), and ProcessHits().

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

Definition at line 742 of file HCalSD.cc.

References fibreNames.

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

Definition at line 718 of file HCalSD.cc.

References hfLevels, hfLV, and hfNames.

Referenced by HCalSD(), and ProcessHits().

718  {
719  const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
720  int levels = (touch->GetHistoryDepth()) + 1;
721  for (unsigned int it=0; it < hfNames.size(); ++it) {
722  if (levels >= hfLevels[it]) {
723  G4LogicalVolume* lv = touch->GetVolume(levels-hfLevels[it])->GetLogicalVolume();
724  if (lv == hfLV[it]) return true;
725  }
726  }
727  return false;
728 }
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 730 of file HCalSD.cc.

References hfNames.

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

Definition at line 772 of file HCalSD.cc.

References applyFidCut, and HFFibreFiducial::PMTNumber().

Referenced by getFromLibrary(), and hitForFibre().

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

Definition at line 748 of file HCalSD.cc.

References pmtLV.

Referenced by ProcessHits().

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

Definition at line 766 of file HCalSD.cc.

References materials.

Referenced by getEnergyDeposit().

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

Definition at line 754 of file HCalSD.cc.

References fibre1LV.

Referenced by ProcessHits().

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

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

1121  {
1122 
1123  double wt = 1.;
1124  if (numberingFromDDD) {
1125  //get the ID's as eta, phi, depth, ... indices
1127  depth, lay);
1128  modifyDepth(tmp);
1129  uint32_t id = HcalTestNumbering::packHcalIndex(tmp.subdet, tmp.zside, 1,
1130  tmp.etaR, tmp.phis,tmp.lay);
1131  std::map<uint32_t,double>::const_iterator ite = layerWeights.find(id);
1132  if (ite != layerWeights.end()) wt = ite->second;
1133 #ifdef DebugLog
1134  edm::LogInfo("HcalSim") << "HCalSD::layerWeight: ID " << std::hex << id
1135  << std::dec << " (" << tmp.subdet << "/"
1136  << tmp.zside << "/1/" << tmp.etaR << "/"
1137  << tmp.phis << "/" << tmp.lay << ") Weight " <<wt;
1138 #endif
1139  }
1140  return wt;
1141 }
#define DebugLog
void modifyDepth(HcalNumberingFromDDD::HcalID &id)
Definition: HCalSD.cc:1199
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 1199 of file HCalSD.cc.

References HLT_25ns14e33_v1_cff::depth, and maxDepthHF.

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

1199  {
1200  if (id.subdet == 4 && maxDepthHF > 2) {
1201  if (id.depth <= 2)
1202  if (G4UniformRand() > 0.5) id.depth += 2;
1203  }
1204 }
G4int maxDepthHF
Definition: HCalSD.h:96
void HCalSD::plotHF ( G4ThreeVector &  pos,
bool  emType 
)
private

Definition at line 1190 of file HCalSD.cc.

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

Referenced by getFromLibrary(), and hitForFibre().

1190  {
1191  double zv = std::abs(hitPoint.z()) - gpar[4];
1192  if (emType) {
1193  if (hzvem != 0) hzvem->Fill(zv);
1194  } else {
1195  if (hzvhad != 0) hzvhad->Fill(zv);
1196  }
1197 }
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 1143 of file HCalSD.cc.

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

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

1144  {
1145 
1146  const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
1147  static G4String modName[8] = {"HEModule", "HVQF" , "HBModule", "MBAT",
1148  "MBBT" , "MBBTC", "MBBT_R1P", "MBBT_R1M"};
1149  G4ThreeVector local;
1150  bool found=false;
1151  double depth=-2000;
1152  int idx = 4;
1153  for (int n=0; n<touch->GetHistoryDepth(); ++n) {
1154  G4String name = touch->GetVolume(n)->GetName();
1155 #ifdef DebugLog
1156  LogDebug("HcalSim") << "plotProfile Depth " << n << " Name " << name;
1157 #endif
1158  for (unsigned int ii=0; ii<8; ++ii) {
1159  if (name == modName[ii]) {
1160  found = true;
1161  int dn = touch->GetHistoryDepth() - n;
1162  local = touch->GetHistory()->GetTransform(dn).TransformPoint(global);
1163  if (ii == 0) {depth = local.z() - 4006.5; idx = 1;}
1164  else if (ii == 1) {depth = local.z() + 825.0; idx = 3;}
1165  else if (ii == 2) {depth = local.x() - 1775.; idx = 0;}
1166  else {depth = local.y() + 15.; idx = 2;}
1167  break;
1168  }
1169  }
1170  if (found) break;
1171  }
1172  if (!found) depth = std::abs(global.z()) - 11500;
1173 #ifdef DebugLog
1174  LogDebug("HcalSim") << "plotProfile Found " << found << " Global " << global
1175  << " Local " << local << " depth " << depth << " ID "
1176  << id << " EDEP " << edep << " Time " << time;
1177 #endif
1178  if (hit_[idx] != 0) hit_[idx]->Fill(edep);
1179  if (time_[idx] != 0) time_[idx]->Fill(time,edep);
1180  if (dist_[idx] != 0) dist_[idx]->Fill(depth,edep);
1181  int jd = 2*idx + id - 7;
1182  if (jd >= 0 && jd < 4) {
1183  jd += 5;
1184  if (hit_[jd] != 0) hit_[jd]->Fill(edep);
1185  if (time_[jd] != 0) time_[jd]->Fill(time,edep);
1186  if (dist_[jd] != 0) dist_[jd]->Fill(depth,edep);
1187  }
1188 }
#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 373 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, puppiForMET_cff::weight, and z.

373  {
374 
375  NaNTrap( aStep ) ;
376 
377  if (aStep == NULL) {
378  return true;
379  } else {
380  G4LogicalVolume* lv =
381  aStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume();
382  G4String nameVolume = lv->GetName();
383  if (isItHF(aStep)) {
384  G4int parCode = aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
385  double weight(1.0);
386  if (m_HFDarkening != 0) {
387  G4ThreeVector hitPoint = aStep->GetPreStepPoint()->GetPosition();
388  double r = hitPoint.perp()/CLHEP::cm;
389  double z = std::abs(hitPoint.z())/CLHEP::cm;
390  float dose_acquired = 0.;
391  if (z>=1100 && z <= 1300) {
392  int hfZLayer = (int)((z - 1100)/20);
393  if (hfZLayer > 9) hfZLayer = 9;
394  float normalized_lumi = m_HFDarkening->int_lumi(deliveredLumi);
395  for (int i = hfZLayer; i <= 9; ++i) {
396  dose_acquired = m_HFDarkening->dose(i,r);
397  weight *= m_HFDarkening->degradation(normalized_lumi*dose_acquired);
398  }
399  }
400 #ifdef DebugLog
401  LogDebug("HcalSim") << "HCalSD: HFLumiDarkening at r = " << r
402  << ", z = " << z << " Dose " << dose_acquired
403  << " weight " << weight;
404 #endif
405  }
406  if (useParam) {
407 #ifdef DebugLog
408  LogDebug("HcalSim") << "HCalSD: " << getNumberOfHits()
409  << " hits from parametrization in " << nameVolume
410  << " for Track " << aStep->GetTrack()->GetTrackID()
411  <<" (" << aStep->GetTrack()->GetDefinition()->GetParticleName()
412  <<")";
413 #endif
414  getFromParam(aStep, weight);
415 #ifdef DebugLog
416  LogDebug("HcalSim") << "HCalSD: " << getNumberOfHits()
417  << " hits afterParamS*";
418 #endif
419  } else {
420  bool notaMuon = true;
421  if (parCode == mupPDG || parCode == mumPDG ) notaMuon = false;
422  if (useShowerLibrary && notaMuon) {
423 #ifdef DebugLog
424  LogDebug("HcalSim") << "HCalSD: Starts shower library from "
425  << nameVolume << " for Track "
426  << aStep->GetTrack()->GetTrackID() << " ("
427  << aStep->GetTrack()->GetDefinition()->GetParticleName() << ")";
428 #endif
429  getFromLibrary(aStep, weight);
430  } else if (isItFibre(lv)) {
431 #ifdef DebugLog
432  LogDebug("HcalSim") << "HCalSD: Hit at Fibre in " << nameVolume
433  << " for Track "
434  << aStep->GetTrack()->GetTrackID() <<" ("
435  << aStep->GetTrack()->GetDefinition()->GetParticleName() << ")";
436 #endif
437  hitForFibre(aStep, weight);
438  }
439  }
440  } else if (isItPMT(lv)) {
441 #ifdef DebugLog
442  LogDebug("HcalSim") << "HCalSD: Hit from PMT parametrization from "
443  << nameVolume << " for Track "
444  << aStep->GetTrack()->GetTrackID() << " ("
445  << aStep->GetTrack()->GetDefinition()->GetParticleName() << ")";
446 #endif
447  if (usePMTHit && showerPMT) getHitPMT(aStep);
448  } else if (isItStraightBundle(lv) || isItConicalBundle(lv)) {
449 #ifdef DebugLog
450  LogDebug("HcalSim") << "HCalSD: Hit from FibreBundle from "
451  << nameVolume << " for Track "
452  << aStep->GetTrack()->GetTrackID() << " ("
453  << aStep->GetTrack()->GetDefinition()->GetParticleName() << ")";
454 #endif
457  } else {
458 #ifdef DebugLog
459  LogDebug("HcalSim") << "HCalSD: Hit from standard path from "
460  << nameVolume << " for Track "
461  << aStep->GetTrack()->GetTrackID() << " ("
462  << aStep->GetTrack()->GetDefinition()->GetParticleName() << ")";
463 #endif
464  if (getStepInfo(aStep)) {
465 #ifdef plotDebug
466  if (edepositEM+edepositHAD > 0)
467  plotProfile(aStep, aStep->GetPreStepPoint()->GetPosition(),
468  edepositEM+edepositHAD,aStep->GetPostStepPoint()->GetGlobalTime(),0);
469 #endif
470  if (hitExists() == false && edepositEM+edepositHAD>0.) currentHit = createNewHit();
471  }
472  }
473  return true;
474  }
475 }
#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:852
void getFromParam(G4Step *step, double weight)
Definition: HCalSD.cc:904
bool isItStraightBundle(G4LogicalVolume *)
Definition: HCalSD.cc:754
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:789
bool usePMTHit
Definition: HCalSD.h:91
bool isItHF(G4Step *)
Definition: HCalSD.cc:718
bool isItConicalBundle(G4LogicalVolume *)
Definition: HCalSD.cc:760
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:943
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:1143
void NaNTrap(G4Step *step)
virtual G4bool getStepInfo(G4Step *aStep)
Definition: CaloSD.cc:250
bool isItPMT(G4LogicalVolume *)
Definition: HCalSD.cc:748
G4int mupPDG
Definition: HCalSD.h:96
void getHitFibreBundle(G4Step *step, bool type)
Definition: HCalSD.cc:1011
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
CaloG4Hit * createNewHit()
Definition: CaloSD.cc:363
bool isItFibre(G4LogicalVolume *)
Definition: HCalSD.cc:736
void HCalSD::readWeightFromFile ( std::string  fName)
private

Definition at line 1095 of file HCalSD.cc.

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

Referenced by HCalSD().

1095  {
1096 
1097  std::ifstream infile;
1098  int entry=0;
1099  infile.open(fName.c_str(), std::ios::in);
1100  if (infile) {
1101  int det, zside, etaR, phi, lay;
1102  double wt;
1103  while (infile >> det >> zside >> etaR >> phi >> lay >> wt) {
1104  uint32_t id = HcalTestNumbering::packHcalIndex(det,zside,1,etaR,phi,lay);
1105  layerWeights.insert(std::pair<uint32_t,double>(id,wt));
1106  ++entry;
1107 #ifdef DebugLog
1108  edm::LogInfo("HcalSim") << "HCalSD::readWeightFromFile:Entry " << entry
1109  << " ID " << std::hex << id << std::dec << " ("
1110  << det << "/" << zside << "/1/" << etaR << "/"
1111  << phi << "/" << lay << ") Weight " << wt;
1112 #endif
1113  }
1114  infile.close();
1115  }
1116  edm::LogInfo("HcalSim") << "HCalSD::readWeightFromFile: reads " << entry
1117  << " weights from " << fName;
1118  if (entry <= 0) useLayerWt = false;
1119 }
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 infile
Definition: EdgesToViz.py:90
std::map< uint32_t, double > layerWeights
Definition: HCalSD.h:102
uint32_t HCalSD::setDetUnitId ( G4Step *  step)
virtual

Implements CaloSD.

Definition at line 573 of file HCalSD.cc.

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

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

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

Definition at line 661 of file HCalSD.cc.

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

661  {
662  uint32_t id = 0;
663  if (numberingFromDDD) {
664  //get the ID's as eta, phi, depth, ... indices
666  modifyDepth(tmp);
667  //get the ID
668  if (numberingScheme) id = numberingScheme->getUnitID(tmp);
669  }
670  return id;
671 }
virtual uint32_t getUnitID(const HcalNumberingFromDDD::HcalID &id)
void modifyDepth(HcalNumberingFromDDD::HcalID &id)
Definition: HCalSD.cc:1199
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 586 of file HCalSD.cc.

References numberingScheme.

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

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

Definition at line 1075 of file HCalSD.cc.

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

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

1075  {
1076  theTrack = aStep->GetTrack();
1077 
1078  double etrack = preStepPoint->GetKineticEnergy();
1079  TrackInformation * trkInfo = (TrackInformation *)(theTrack->GetUserInformation());
1080  int primaryID = trkInfo->getIDonCaloSurface();
1081  if (primaryID == 0) {
1082 #ifdef DebugLog
1083  edm::LogInfo("HcalSim") << "HCalSD: Problem with primaryID **** set by "
1084  << "force to TkID **** " <<theTrack->GetTrackID();
1085 #endif
1086  primaryID = theTrack->GetTrackID();
1087  }
1088 
1089  if (primaryID != previousID.trackID())
1090  resetForNewPrimary(preStepPoint->GetPosition(), etrack);
1091 
1092  return primaryID;
1093 }
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 594 of file HCalSD.cc.

References Exception, edm::EventSetup::get(), HcalDDDSimConstants::getGparHF(), HcalDDDSimConstants::getLayer0Wt(), HcalDDDSimConstants::getMaxDepth(), gpar, hcalConstants, layer0wt, maxDepthHF, 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().

594  {
595 
596  const edm::EventSetup* es = (*job)();
598  es->get<HcalSimNumberingRecord>().get(hdc);
599  if (hdc.isValid()) {
600  hcalConstants = (HcalDDDSimConstants*)(&(*hdc));
601  } else {
602  edm::LogError("HcalSim") << "HCalSD : Cannot find HcalDDDSimConstant";
603  throw cms::Exception("Unknown", "HCalSD") << "Cannot find HcalDDDSimConstant" << "\n";
604  }
605 
607 
609  edm::LogInfo("HcalSim") << "Maximum depth for HF " << maxDepthHF;
610 
611  //Special Geometry parameters
613  edm::LogInfo("HcalSim") << "HCalSD: " << gpar.size()<< " gpar (cm)";
614  for (unsigned int ig=0; ig<gpar.size(); ig++)
615  edm::LogInfo("HcalSim") << "HCalSD: gpar[" << ig << "] = "
616  << gpar[ig]/cm << " cm";
617 
618  //Layer0 Weight
620  edm::LogInfo("HcalSim") << "HCalSD: " << layer0wt.size() << " Layer0Wt";
621  for (unsigned int it=0; it<layer0wt.size(); ++it)
622  edm::LogInfo("HcalSim") << "HCalSD: [" << it << "] " << layer0wt[it];
623 
624 }
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
G4int maxDepthHF
Definition: HCalSD.h:96
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(), 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::maxDepthHF
private

Definition at line 96 of file HCalSD.h.

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

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().