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
 
G4int depth_
 
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::map< uint32_t, double > layerWeights
 
HEDarkeningm_HEDarkening
 
HFDarkeningm_HFDarkening
 
std::vector< G4Material * > materials
 
std::vector< G4String > matNames
 
G4int mumPDG
 
G4int mupPDG
 
bool neutralDensity
 
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_FULL_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(), neutralDensity, DDFilteredView::next(), not_equals, pmtLV, readWeightFromFile(), DDSpecificsFilter::setCriteria(), setNumberingScheme(), showerBundle, showerLibrary, showerParam, showerPMT, AlCaHLTBitMon_QueryRunRegistry::string, CaloSD::suppressHeavy, groupFilesInBlocks::temp, testNumber, compare::tfile, time_, SiPixelPhase1TrackClusters_cfi::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), depth_(1) {
51 
52  //static SimpleConfigurable<double> bk1(0.013, "HCalSD:BirkC1");
53  //static SimpleConfigurable<double> bk2(0.0568,"HCalSD:BirkC2");
54  //static SimpleConfigurable<double> bk3(1.75, "HCalSD:BirkC3");
55  // Values from NIM 80 (1970) 239-244: as implemented in Geant3
56 
57  edm::ParameterSet m_HC = p.getParameter<edm::ParameterSet>("HCalSD");
58  useBirk = m_HC.getParameter<bool>("UseBirkLaw");
59  birk1 = m_HC.getParameter<double>("BirkC1")*(g/(MeV*cm2));
60  birk2 = m_HC.getParameter<double>("BirkC2");
61  birk3 = m_HC.getParameter<double>("BirkC3");
62  useShowerLibrary = m_HC.getParameter<bool>("UseShowerLibrary");
63  useParam = m_HC.getParameter<bool>("UseParametrize");
64  testNumber = m_HC.getParameter<bool>("TestNumberingScheme");
65  neutralDensity = m_HC.getParameter<bool>("doNeutralDensityFilter");
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  << "Flag for test number|neutral density filter "
114  << testNumber << " " << neutralDensity;
115 
116  HcalNumberingScheme* scheme;
117  if (testNumber || forTBH2)
118  scheme = dynamic_cast<HcalNumberingScheme*>(new HcalTestNumberingScheme(forTBH2));
119  else
120  scheme = new HcalNumberingScheme();
121  setNumberingScheme(scheme);
122 
123  const G4LogicalVolumeStore * lvs = G4LogicalVolumeStore::GetInstance();
124  std::vector<G4LogicalVolume *>::const_iterator lvcite;
125  G4LogicalVolume* lv;
126  std::string attribute, value;
127  if (useHF) {
128  if (useParam) {
129  showerParam = new HFShowerParam(name, cpv, p);
130  } else {
131  if (useShowerLibrary) showerLibrary = new HFShowerLibrary(name, cpv, p);
132  hfshower = new HFShower(name, cpv, p, 0);
133  }
134 
135  // HF volume names
136  attribute = "Volume";
137  value = "HF";
138  DDSpecificsFilter filter0;
139  DDValue ddv0(attribute, value, 0);
140  filter0.setCriteria(ddv0, DDCompOp::equals);
141  DDFilteredView fv0(cpv);
142  fv0.addFilter(filter0);
143  hfNames = getNames(fv0);
144  fv0.firstChild();
145  DDsvalues_type sv0(fv0.mergedSpecifics());
146  std::vector<double> temp = getDDDArray("Levels",sv0);
147  edm::LogInfo("HcalSim") << "HCalSD: Names to be tested for " << attribute
148  << " = " << value << " has " << hfNames.size()
149  << " elements";
150  for (unsigned int i=0; i < hfNames.size(); ++i) {
151  G4String namv = hfNames[i];
152  lv = 0;
153  for(lvcite=lvs->begin(); lvcite!=lvs->end(); lvcite++)
154  if((*lvcite)->GetName()==namv) {
155  lv = (*lvcite);
156  break;
157  }
158  hfLV.push_back(lv);
159  int level = static_cast<int>(temp[i]);
160  hfLevels.push_back(level);
161  edm::LogInfo("HcalSim") << "HCalSD: HF[" << i << "] = " << hfNames[i]
162  << " LV " << hfLV[i] << " at level "
163  << hfLevels[i];
164  }
165 
166  // HF Fibre volume names
167  value = "HFFibre";
168  DDSpecificsFilter filter1;
169  DDValue ddv1(attribute,value,0);
170  filter1.setCriteria(ddv1, DDCompOp::equals);
171  DDFilteredView fv1(cpv);
172  fv1.addFilter(filter1);
173  fibreNames = getNames(fv1);
174  edm::LogInfo("HcalSim") << "HCalSD: Names to be tested for " << attribute
175  << " = " << value << ":";
176  for (unsigned int i=0; i<fibreNames.size(); ++i) {
177  G4String namv = fibreNames[i];
178  lv = 0;
179  for (lvcite = lvs->begin(); lvcite != lvs->end(); ++lvcite) {
180  if ((*lvcite)->GetName() == namv) {
181  lv = (*lvcite);
182  break;
183  }
184  }
185  fibreLV.push_back(lv);
186  edm::LogInfo("HcalSim") << "HCalSD: (" << i << ") " << fibreNames[i]
187  << " LV " << fibreLV[i];
188  }
189 
190  // HF PMT volume names
191  value = "HFPMT";
192  DDSpecificsFilter filter3;
193  DDValue ddv3(attribute,value,0);
194  filter3.setCriteria(ddv3,DDCompOp::equals);
195  DDFilteredView fv3(cpv);
196  fv3.addFilter(filter3);
197  std::vector<G4String> pmtNames = getNames(fv3);
198  edm::LogInfo("HcalSim") << "HCalSD: Names to be tested for " << attribute
199  << " = " << value << " have " << pmtNames.size()
200  << " entries";
201  for (unsigned int i=0; i<pmtNames.size(); ++i) {
202  G4String namv = pmtNames[i];
203  lv = 0;
204  for (lvcite = lvs->begin(); lvcite != lvs->end(); ++lvcite)
205  if ((*lvcite)->GetName() == namv) {
206  lv = (*lvcite);
207  break;
208  }
209  pmtLV.push_back(lv);
210  edm::LogInfo("HcalSim") << "HCalSD: (" << i << ") " << pmtNames[i]
211  << " LV " << pmtLV[i];
212  }
213  if (pmtNames.size() > 0) showerPMT = new HFShowerPMT (name, cpv, p);
214 
215  // HF Fibre bundles
216  value = "HFFibreBundleStraight";
217  DDSpecificsFilter filter4;
218  DDValue ddv4(attribute,value,0);
219  filter4.setCriteria(ddv4,DDCompOp::equals);
220  DDFilteredView fv4(cpv);
221  fv4.addFilter(filter4);
222  std::vector<G4String> fibreNames = getNames(fv4);
223  edm::LogInfo("HcalSim") << "HCalSD: Names to be tested for " << attribute
224  << " = " << value << " have " << fibreNames.size()
225  << " entries";
226  for (unsigned int i=0; i<fibreNames.size(); ++i) {
227  G4String namv = fibreNames[i];
228  lv = 0;
229  for (lvcite = lvs->begin(); lvcite != lvs->end(); lvcite++)
230  if ((*lvcite)->GetName() == namv) {
231  lv = (*lvcite);
232  break;
233  }
234  fibre1LV.push_back(lv);
235  edm::LogInfo("HcalSim") << "HCalSD: (" << i << ") " << fibreNames[i]
236  << " LV " << fibre1LV[i];
237  }
238 
239  // Geometry parameters for HF
240  value = "HFFibreBundleConical";
241  DDSpecificsFilter filter5;
242  DDValue ddv5(attribute,value,0);
243  filter5.setCriteria(ddv5,DDCompOp::equals);
244  DDFilteredView fv5(cpv);
245  fv5.addFilter(filter5);
246  fibreNames = getNames(fv5);
247  edm::LogInfo("HcalSim") << "HCalSD: Names to be tested for " << attribute
248  << " = " << value << " have " << fibreNames.size()
249  << " entries";
250  for (unsigned int i=0; i<fibreNames.size(); ++i) {
251  G4String namv = fibreNames[i];
252  lv = 0;
253  for (lvcite = lvs->begin(); lvcite != lvs->end(); ++lvcite)
254  if ((*lvcite)->GetName() == namv) {
255  lv = (*lvcite);
256  break;
257  }
258  fibre2LV.push_back(lv);
259  edm::LogInfo("HcalSim") << "HCalSD: (" << i << ") " << fibreNames[i]
260  << " LV " << fibre2LV[i];
261  }
262  if (fibre1LV.size() > 0 || fibre2LV.size() > 0)
263  showerBundle = new HFShowerFibreBundle (name, cpv, p);
264  }
265 
266  //Material list for HB/HE/HO sensitive detectors
267  const G4MaterialTable * matTab = G4Material::GetMaterialTable();
268  std::vector<G4Material*>::const_iterator matite;
269  attribute = "OnlyForHcalSimNumbering";
270  value = "any";
271  DDSpecificsFilter filter2;
272  DDValue ddv2(attribute,value,0);
273  filter2.setCriteria(ddv2, DDCompOp::not_equals,
274  DDLogOp::AND, true, true);
275  DDFilteredView fv2(cpv);
276  fv2.addFilter(filter2);
277  bool dodet = fv2.firstChild();
278  DDsvalues_type sv(fv2.mergedSpecifics());
279 
280  while (dodet) {
281  const DDLogicalPart & log = fv2.logicalPart();
282  G4String namx = log.name().name();
283  if (!isItHF(namx) && !isItFibre(namx)) {
284  bool notIn = true;
285  for (unsigned int i=0; i<matNames.size(); ++i) {
286  if (!strcmp(matNames[i].c_str(),log.material().name().name().c_str())){
287  notIn = false;
288  break;
289  }
290  }
291  if (notIn) {
292  namx = log.material().name().name();
293  matNames.push_back(namx);
294  G4Material* mat = nullptr;
295  for (matite = matTab->begin(); matite != matTab->end(); ++matite) {
296  if ((*matite)->GetName() == namx) {
297  mat = (*matite);
298  break;
299  }
300  }
301  materials.push_back(mat);
302  }
303  }
304  dodet = fv2.next();
305  }
306 
307  edm::LogInfo("HcalSim") << "HCalSD: Material names for " << attribute
308  << " = " << name << ":";
309  for (unsigned int i=0; i<matNames.size(); ++i)
310  edm::LogInfo("HcalSim") << "HCalSD: (" << i << ") " << matNames[i]
311  << " pointer " << materials[i];
312 
313  mumPDG = mupPDG = 0;
314 
315  if (useLayerWt) readWeightFromFile(file);
316 
317  for (int i=0; i<9; ++i) hit_[i] = time_[i]= dist_[i] = 0;
318  hzvem = hzvhad = 0;
319 
320  if (ageingFlagHE) m_HEDarkening = new HEDarkening();
321  if (ageingFlagHF) m_HFDarkening = new HFDarkening(m_HC.getParameter<edm::ParameterSet>("HFDarkeningParameterBlock"));
322 #ifdef plotDebug
324 
325  if ( tfile.isAvailable() ) {
326  static const char * const labels[] = {"HB", "HE", "HO", "HF Absorber", "HF PMT",
327  "HF Absorber Long", "HF Absorber Short",
328  "HF PMT Long", "HF PMT Short"};
329  TFileDirectory hcDir = tfile->mkdir("ProfileFromHCalSD");
330  char name[20], title[60];
331  for (int i=0; i<9; ++i) {
332  sprintf (title, "Hit energy in %s", labels[i]);
333  sprintf (name, "HCalSDHit%d", i);
334  hit_[i] = hcDir.make<TH1F>(name, title, 2000, 0., 2000.);
335  sprintf (title, "Energy (MeV)");
336  hit_[i]->GetXaxis()->SetTitle(title);
337  hit_[i]->GetYaxis()->SetTitle("Hits");
338  sprintf (title, "Time of the hit in %s", labels[i]);
339  sprintf (name, "HCalSDTime%d", i);
340  time_[i] = hcDir.make<TH1F>(name, title, 2000, 0., 2000.);
341  sprintf (title, "Time (ns)");
342  time_[i]->GetXaxis()->SetTitle(title);
343  time_[i]->GetYaxis()->SetTitle("Hits");
344  sprintf (title, "Longitudinal profile in %s", labels[i]);
345  sprintf (name, "HCalSDDist%d", i);
346  dist_[i] = hcDir.make<TH1F>(name, title, 2000, 0., 2000.);
347  sprintf (title, "Distance (mm)");
348  dist_[i]->GetXaxis()->SetTitle(title);
349  dist_[i]->GetYaxis()->SetTitle("Hits");
350  }
351  if (useHF && (!useParam)) {
352  hzvem = hcDir.make<TH1F>("hzvem", "Longitudinal Profile (EM Part)",330,0.0,1650.0);
353  hzvem->GetXaxis()->SetTitle("Longitudinal Profile (EM Part)");
354  hzvhad = hcDir.make<TH1F>("hzvhad","Longitudinal Profile (Had Part)",330,0.0,1650.0);
355  hzvhad->GetXaxis()->SetTitle("Longitudinal Profile (Hadronic Part)");
356  }
357  }
358 #endif
359 }
#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:94
double eminHitHE
Definition: HCalSD.h:95
HFShowerParam * showerParam
Definition: HCalSD.h:86
TH1F * time_[9]
Definition: HCalSD.h:104
double kmaxNeutron
Definition: CaloSD.h:134
const N & name() const
Definition: DDBase.h:78
G4int depth_
Definition: HCalSD.h:97
bool useLayerWt
Definition: HCalSD.h:91
bool useFibreBundle
Definition: HCalSD.h:91
double betaThr
Definition: HCalSD.h:93
double deliveredLumi
Definition: HCalSD.h:96
HFShowerFibreBundle * showerBundle
Definition: HCalSD.h:88
std::vector< G4LogicalVolume * > fibre1LV
Definition: HCalSD.h:102
std::vector< G4LogicalVolume * > fibreLV
Definition: HCalSD.h:102
double eminHitHB
Definition: HCalSD.h:95
bool useShowerLibrary
Definition: HCalSD.h:94
std::vector< double > getDDDArray(const std::string &, const DDsvalues_type &)
Definition: HCalSD.cc:649
double birk2
Definition: HCalSD.h:93
bool usePMTHit
Definition: HCalSD.h:91
void setNumberingScheme(HcalNumberingScheme *)
Definition: HCalSD.cc:571
double birk1
Definition: HCalSD.h:93
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:694
TH1F * hzvhad
Definition: HCalSD.h:104
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:95
const double MeV
TH1F * hit_[9]
Definition: HCalSD.h:104
bool testNumber
Definition: HCalSD.h:92
std::vector< G4LogicalVolume * > pmtLV
Definition: HCalSD.h:102
std::vector< G4LogicalVolume * > hfLV
Definition: HCalSD.h:102
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:93
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:20
bool isAvailable() const
Definition: Service.h:46
bool applyFidCut
Definition: HCalSD.h:94
TH1F * dist_[9]
Definition: HCalSD.h:104
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:92
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:99
virtual std::vector< std::string > getNames()
HEDarkening * m_HEDarkening
Definition: HCalSD.h:89
G4int mupPDG
Definition: HCalSD.h:97
double eminHitHO
Definition: HCalSD.h:95
TH1F * hzvem
Definition: HCalSD.h:104
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:1071
bool neutralDensity
Definition: HCalSD.h:92
HcalNumberingFromDDD * numberingFromDDD
Definition: HCalSD.h:82
std::vector< G4String > fibreNames
Definition: HCalSD.h:100
std::vector< G4Material * > materials
Definition: HCalSD.h:101
std::vector< G4String > hfNames
Definition: HCalSD.h:100
G4int mumPDG
Definition: HCalSD.h:97
tuple level
Definition: testEve_cfg.py:34
tuple tfile
Definition: compare.py:321
HFShowerPMT * showerPMT
Definition: HCalSD.h:87
HFShowerLibrary * showerLibrary
Definition: HCalSD.h:84
std::vector< G4LogicalVolume * > fibre2LV
Definition: HCalSD.h:102
const std::string & name() const
Returns the name.
Definition: DDName.cc:90
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:253
std::vector< G4String > matNames
Definition: HCalSD.h:100
bool isItFibre(G4LogicalVolume *)
Definition: HCalSD.cc:712
bool useHF
Definition: HCalSD.h:94
HcalDDDSimConstants * hcalConstants
Definition: HCalSD.h:81
The DDGenericFilter is a runtime-parametrized Filter looking on DDSpecifcs.
Definition: DDFilter.h:33
HCalSD::~HCalSD ( )
virtual

Definition at line 361 of file HCalSD.cc.

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

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

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

619  {
620  double threshold=0;
621  DetId theId(aHit->getUnitID());
622  switch (theId.subdetId()) {
623  case HcalBarrel:
624  threshold = eminHitHB; break;
625  case HcalEndcap:
626  threshold = eminHitHE; break;
627  case HcalOuter:
628  threshold = eminHitHO; break;
629  case HcalForward:
630  threshold = eminHitHF; break;
631  default:
632  break;
633  }
634  return ((time <= tmaxHit) && (aHit->getEnergyDeposit() > threshold));
635 }
double eminHitHE
Definition: HCalSD.h:95
double eminHitHB
Definition: HCalSD.h:95
double eminHitHF
Definition: HCalSD.h:95
double eminHitHO
Definition: HCalSD.h:95
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 649 of file HCalSD.cc.

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

Referenced by HCalSD().

650  {
651 #ifdef DebugLog
652  LogDebug("HcalSim") << "HCalSD:getDDDArray called for " << str;
653 #endif
654  DDValue value(str);
655  if (DDfetch(&sv,value)) {
656 #ifdef DebugLog
657  LogDebug("HcalSim") << value;
658 #endif
659  const std::vector<double> & fvec = value.doubles();
660  int nval = fvec.size();
661  if (nval < 1) {
662  edm::LogError("HcalSim") << "HCalSD : # of " << str << " bins " << nval
663  << " < 2 ==> illegal";
664  throw cms::Exception("Unknown", "HCalSD") << "nval < 2 for array " << str << "\n";
665  }
666 
667  return fvec;
668  } else {
669  edm::LogError("HcalSim") << "HCalSD : cannot get array " << str;
670  throw cms::Exception("Unknown", "HCalSD") << "cannot get array " << str << "\n";
671  }
672 }
#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 479 of file HCalSD.cc.

References birk1, birk2, birk3, HEDarkening::degradation(), deliveredLumi, HLT_FULL_cff::depth, depth_, CaloSD::getAttenuation(), HcalDDDSimConstants::getLayer0Wt(), CaloSD::getResponseWt(), hcalConstants, HcalDetId::ietaAbs(), HcalDetId::iphi(), isItScintillator(), TrackInformation::isPrimary(), ke, CaloSD::kmaxIon, CaloSD::kmaxNeutron, CaloSD::kmaxProton, layerWeight(), m_HEDarkening, MeV, neutralDensity, phi, setDetUnitId(), DetId::subdetId(), CaloSD::suppressHeavy, testNumber, CaloSD::theTrack, HcalTestNumbering::unpackHcalIndex(), useBirk, useLayerWt, histoStyle::weight, z, and HcalDetId::zside().

479  {
480  double destep = aStep->GetTotalEnergyDeposit();
481  double weight = 1;
482  G4Track* theTrack = aStep->GetTrack();
483 
484  const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
485  uint32_t detid = setDetUnitId(aStep);
486  int det(0), ieta(0), phi(0), z(0), lay, depth(-1);
487  if (testNumber) {
488  HcalTestNumbering::unpackHcalIndex(detid,det,z,depth,ieta,phi,lay);
489  if (z==0) z = -1;
490  } else {
491  HcalDetId hcid(detid);
492  det = hcid.subdetId();
493  ieta = hcid.ietaAbs();
494  phi = hcid.iphi();
495  z = hcid.zside();
496  }
497  lay = (touch->GetReplicaNumber(0)/10)%100 + 1;
498 #ifdef DebugLog
499  edm::LogInfo("HcalSim") << "HCalSD: det: " << det << " ieta: "<< ieta
500  << " iphi: " << phi << " zside " << z << " lay: "
501  << lay-2;
502 #endif
503  if (depth_==0 && (det==1 || det==2) && ((!testNumber) || neutralDensity))
504  weight = hcalConstants->getLayer0Wt(det,phi,z);
505  if (useLayerWt) {
506  G4ThreeVector hitPoint = aStep->GetPreStepPoint()->GetPosition();
507  weight = layerWeight(det+2, hitPoint, depth_, lay);
508  }
509 
510  if (m_HEDarkening !=0 && det == 2) {
511  float dweight = m_HEDarkening->degradation(deliveredLumi,ieta,lay-2);//NB:diff. layer count
512  weight *= dweight;
513 #ifdef DebugLog
514  edm::LogInfo("HcalSim") << "HCalSD: >>> Lumi: " << deliveredLumi
515  << " coefficient = " << dweight;
516 #endif
517  }
518 
519  if (suppressHeavy) {
520  TrackInformation * trkInfo = (TrackInformation *)(theTrack->GetUserInformation());
521  if (trkInfo) {
522  int pdg = theTrack->GetDefinition()->GetPDGEncoding();
523  if (!(trkInfo->isPrimary())) { // Only secondary particles
524  double ke = theTrack->GetKineticEnergy()/MeV;
525  if ( pdg/1000000000 == 1 && (pdg/10000)%100 > 0 &&
526  (pdg/10)%100 > 0 && ke <kmaxIon ) weight = 0;
527  if ((pdg == 2212) && (ke < kmaxProton)) weight = 0;
528  if ((pdg == 2112) && (ke < kmaxNeutron)) weight = 0;
529 #ifdef DebugLog
530  if (weight == 0)
531  edm::LogInfo("HcalSim") << "HCalSD:Ignore Track "
532  << theTrack->GetTrackID() << " Type "
533  << theTrack->GetDefinition()->GetParticleName()
534  << " Kinetic Energy " << ke << " MeV";
535 #endif
536  }
537  }
538  }
539 #ifdef DebugLog
540  double weight0 = weight;
541 #endif
542  if (useBirk) {
543  G4Material* mat = aStep->GetPreStepPoint()->GetMaterial();
544  if (isItScintillator(mat)) weight *= getAttenuation(aStep, birk1, birk2, birk3);
545  }
546  double wt1 = getResponseWt(theTrack);
547  double wt2 = theTrack->GetWeight();
548 #ifdef DebugLog
549  edm::LogInfo("HcalSim") << "HCalSD: Detector " << det+2 << " Depth " << depth_
550  << " weight " << weight0 << " " << weight << " " << wt1
551  << " " << wt2;
552 #endif
553  double edep = weight*wt1*destep;
554  if (wt2 > 0.0) { edep *= wt2; }
555  return edep;
556 }
double kmaxNeutron
Definition: CaloSD.h:134
G4int depth_
Definition: HCalSD.h:97
bool useLayerWt
Definition: HCalSD.h:91
double getLayer0Wt(int det, int phi, int zside) const
double deliveredLumi
Definition: HCalSD.h:96
virtual uint32_t setDetUnitId(G4Step *step)
Definition: HCalSD.cc:558
double birk2
Definition: HCalSD.h:93
double birk1
Definition: HCalSD.h:93
double kmaxProton
Definition: CaloSD.h:134
const double MeV
bool testNumber
Definition: HCalSD.h:92
double kmaxIon
Definition: CaloSD.h:134
bool suppressHeavy
Definition: CaloSD.h:132
bool isItScintillator(G4Material *)
Definition: HCalSD.cc:742
bool useBirk
Definition: HCalSD.h:91
double birk3
Definition: HCalSD.h:93
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
bool neutralDensity
Definition: HCalSD.h:92
int ke
bool isPrimary() const
double layerWeight(int, const G4ThreeVector &, int, int)
Definition: HCalSD.cc:1097
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
HcalDDDSimConstants * hcalConstants
Definition: HCalSD.h:81
void HCalSD::getFromLibrary ( G4Step *  step,
double  weight 
)
private

Definition at line 765 of file HCalSD.cc.

References CaloSD::checkHit(), CaloSD::createNewHit(), CaloSD::currentHit, CaloSD::currentID, HLT_FULL_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().

765  {
766  preStepPoint = aStep->GetPreStepPoint();
767  theTrack = aStep->GetTrack();
768  int det = 5;
769  bool ok;
770 
771  std::vector<HFShowerLibrary::Hit> hits = showerLibrary->getHits(aStep, ok, weight, false);
772 
773  double etrack = preStepPoint->GetKineticEnergy();
774  int primaryID = setTrackID(aStep);
775 
776  // Reset entry point for new primary
777  posGlobal = preStepPoint->GetPosition();
778  resetForNewPrimary(posGlobal, etrack);
779 
780  G4int particleCode = theTrack->GetDefinition()->GetPDGEncoding();
781  if (particleCode==emPDG || particleCode==epPDG || particleCode==gammaPDG) {
782  edepositEM = 1.*GeV;
783  edepositHAD = 0.;
784  } else {
785  edepositEM = 0.;
786  edepositHAD = 1.*GeV;
787  }
788 #ifdef DebugLog
789  edm::LogInfo("HcalSim") << "HCalSD::getFromLibrary " <<hits.size()
790  << " hits for " << GetName() << " of " << primaryID
791  << " with " << theTrack->GetDefinition()->GetParticleName()
792  << " of " << preStepPoint->GetKineticEnergy()/GeV << " GeV";
793 #endif
794  for (unsigned int i=0; i<hits.size(); ++i) {
795  G4ThreeVector hitPoint = hits[i].position;
796  if (isItinFidVolume (hitPoint)) {
797  int depth = hits[i].depth;
798  double time = hits[i].time;
799  unsigned int unitID = setDetUnitId(det, hitPoint, depth);
800  currentID.setID(unitID, time, primaryID, 0);
801 #ifdef plotDebug
802  plotProfile(aStep, hitPoint, 1.0*GeV, time, depth);
803  bool emType = false;
804  if (particleCode==emPDG || particleCode==epPDG || particleCode==gammaPDG)
805  emType = true;
806  plotHF(hitPoint,emType);
807 #endif
808 
809  // check if it is in the same unit and timeslice as the previous one
810  if (currentID == previousID) {
812  } else {
813  if (!checkHit()) currentHit = createNewHit();
814  }
815  }
816  }
817 
818  //Now kill the current track
819  if (ok) {
820  theTrack->SetTrackStatus(fStopAndKill);
821  G4TrackVector tv = *(aStep->GetSecondary());
822  for (unsigned int kk=0; kk<tv.size(); ++kk)
823  if (tv[kk]->GetVolume() == preStepPoint->GetPhysicalVolume())
824  tv[kk]->SetTrackStatus(fStopAndKill);
825  }
826 }
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:748
std::vector< Hit > getHits(G4Step *aStep, bool &ok, double weight, bool onlyLong=false)
virtual uint32_t setDetUnitId(G4Step *step)
Definition: HCalSD.cc:558
int setTrackID(G4Step *step)
Definition: HCalSD.cc:1051
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:1166
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:1119
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 880 of file HCalSD.cc.

References CaloSD::checkHit(), CaloSD::createNewHit(), CaloSD::currentHit, CaloSD::currentID, HLT_FULL_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().

880  {
881  std::vector<HFShowerParam::Hit> hits = showerParam->getHits(aStep, weight);
882  int nHit = static_cast<int>(hits.size());
883 
884  if (nHit > 0) {
885  preStepPoint = aStep->GetPreStepPoint();
886  int primaryID = setTrackID(aStep);
887 
888  int det = 5;
889 #ifdef DebugLog
890  edm::LogInfo("HcalSim") << "HCalSD::getFromParam " << nHit << " hits for "
891  << GetName() << " of " << primaryID << " with "
892  << aStep->GetTrack()->GetDefinition()->GetParticleName()
893  << " of " << preStepPoint->GetKineticEnergy()/GeV
894  << " GeV in detector type " << det;
895 #endif
896  for (int i = 0; i<nHit; ++i) {
897  G4ThreeVector hitPoint = hits[i].position;
898  int depth = hits[i].depth;
899  double time = hits[i].time;
900  unsigned int unitID = setDetUnitId(det, hitPoint, depth);
901  currentID.setID(unitID, time, primaryID, 0);
902  edepositEM = hits[i].edep*GeV;
903  edepositHAD = 0.;
904 #ifdef plotDebug
905  plotProfile(aStep, hitPoint, edepositEM, time, depth);
906 #endif
907 
908  // check if it is in the same unit and timeslice as the previous one
909  if (currentID == previousID) {
911  } else {
912  posGlobal = preStepPoint->GetPosition();
913  if (!checkHit()) currentHit = createNewHit();
914  }
915  }
916  }
917 }
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:558
int setTrackID(G4Step *step)
Definition: HCalSD.cc:1051
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:1119
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 987 of file HCalSD.cc.

References beta, CaloSD::checkHit(), CaloSD::createNewHit(), CaloSD::currentHit, CaloSD::currentID, TauDecayModes::dec, HLT_FULL_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().

987  {
988  preStepPoint = aStep->GetPreStepPoint();
989  theTrack = aStep->GetTrack();
990  double edep = showerBundle->getHits(aStep, type);
991 
992  if (edep >= 0) {
993  double etrack = preStepPoint->GetKineticEnergy();
994  int primaryID = 0;
995  if (etrack >= energyCut) {
996  primaryID = theTrack->GetTrackID();
997  } else {
998  primaryID = theTrack->GetParentID();
999  if (primaryID == 0) primaryID = theTrack->GetTrackID();
1000  }
1001  // Reset entry point for new primary
1002  posGlobal = preStepPoint->GetPosition();
1003  resetForNewPrimary(posGlobal, etrack);
1004 
1005  //
1006  int det = static_cast<int>(HcalForward);
1007  G4ThreeVector hitPoint = preStepPoint->GetPosition();
1008  double rr = (hitPoint.x()*hitPoint.x() + hitPoint.y()*hitPoint.y());
1009  double phi = (rr == 0. ? 0. :atan2(hitPoint.y(),hitPoint.x()));
1010  double etaR = showerBundle->getRadius();
1011  int depth = 1;
1012  if (etaR < 0) {
1013  depth = 2;
1014  etaR =-etaR;
1015  }
1016  if (hitPoint.z() < 0) etaR =-etaR;
1017 #ifdef DebugLog
1018  LogDebug("HcalSim") << "HCalSD::Hit for Detector " << det << " etaR "
1019  << etaR << " phi " << phi/deg << " depth " <<depth;
1020 #endif
1021  double time = (aStep->GetPostStepPoint()->GetGlobalTime());
1022  uint32_t unitID = 0;
1023  if (numberingFromDDD) {
1024  HcalNumberingFromDDD::HcalID tmp = numberingFromDDD->unitID(det,etaR,phi,depth,1);
1025  modifyDepth(tmp);
1026  if (numberingScheme) unitID = numberingScheme->getUnitID(tmp);
1027  }
1028  if (type) currentID.setID(unitID, time, primaryID, 3);
1029  else currentID.setID(unitID, time, primaryID, 2);
1030 
1031  edepositHAD = aStep->GetTotalEnergyDeposit();
1032  edepositEM =-edepositHAD + (edep*GeV);
1033 #ifdef plotDebug
1034  plotProfile(aStep, hitPoint, edep*GeV, time, depth);
1035 #endif
1036 #ifdef DebugLog
1037  double beta = preStepPoint->GetBeta();
1038  LogDebug("HcalSim") << "HCalSD::getHitFibreBundle 1 hit for " << GetName()
1039  << " of " << primaryID << " with "
1040  << theTrack->GetDefinition()->GetParticleName()
1041  << " of " << preStepPoint->GetKineticEnergy()/GeV
1042  << " GeV with velocity " << beta << " UnitID "
1043  << std::hex << unitID << std::dec;
1044 #endif
1045  // check if it is in the same unit and timeslice as the previous one
1047  else if (!checkHit()) currentHit = createNewHit();
1048  } // non-zero energy deposit
1049 }
#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:1175
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:1119
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 919 of file HCalSD.cc.

References beta, CaloSD::checkHit(), CaloSD::createNewHit(), CaloSD::currentHit, CaloSD::currentID, TauDecayModes::dec, HLT_FULL_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().

919  {
920 
921  preStepPoint = aStep->GetPreStepPoint();
922  theTrack = aStep->GetTrack();
923  double edep = showerPMT->getHits(aStep);
924 
925  if (edep >= 0) {
926  double etrack = preStepPoint->GetKineticEnergy();
927  int primaryID = 0;
928  if (etrack >= energyCut) {
929  primaryID = theTrack->GetTrackID();
930  } else {
931  primaryID = theTrack->GetParentID();
932  if (primaryID == 0) primaryID = theTrack->GetTrackID();
933  }
934  // Reset entry point for new primary
935  posGlobal = preStepPoint->GetPosition();
936  resetForNewPrimary(posGlobal, etrack);
937 
938  //
939  int det = static_cast<int>(HcalForward);
940  G4ThreeVector hitPoint = preStepPoint->GetPosition();
941  double rr = (hitPoint.x()*hitPoint.x() + hitPoint.y()*hitPoint.y());
942  double phi = (rr == 0. ? 0. :atan2(hitPoint.y(),hitPoint.x()));
943  double etaR = showerPMT->getRadius();
944  int depth = 1;
945  if (etaR < 0) {
946  depth = 2;
947  etaR =-etaR;
948  }
949  if (hitPoint.z() < 0) etaR =-etaR;
950 #ifdef DebugLog
951  edm::LogInfo("HcalSim") << "HCalSD::Hit for Detector " << det << " etaR "
952  << etaR << " phi " << phi/deg << " depth " <<depth;
953 #endif
954  double time = (aStep->GetPostStepPoint()->GetGlobalTime());
955  uint32_t unitID = 0;
956  if (numberingFromDDD) {
958  depth,1);
959  modifyDepth(tmp);
960  if (numberingScheme) unitID = numberingScheme->getUnitID(tmp);
961  }
962  currentID.setID(unitID, time, primaryID, 1);
963 
964  edepositHAD = aStep->GetTotalEnergyDeposit();
965  edepositEM =-edepositHAD + (edep*GeV);
966 #ifdef plotDebug
967  plotProfile(aStep, hitPoint, edep*GeV, time, depth);
968 #endif
969 #ifdef DebugLog
970  double beta = preStepPoint->GetBeta();
971  LogDebug("HcalSim") << "HCalSD::getHitPMT 1 hit for " << GetName()
972  << " of " << primaryID << " with "
973  << theTrack->GetDefinition()->GetParticleName()
974  << " of " << preStepPoint->GetKineticEnergy()/GeV
975  << " GeV with velocity " << beta << " UnitID "
976  << std::hex << unitID << std::dec;
977 #endif
978  // check if it is in the same unit and timeslice as the previous one
979  if (currentID == previousID) {
981  } else {
982  if (!checkHit()) currentHit = createNewHit();
983  }
984  }
985 }
#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:1175
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:1119
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 674 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.

674  {
675 
676  std::vector<G4String> tmp;
677  bool dodet = fv.firstChild();
678  while (dodet) {
679  const DDLogicalPart & log = fv.logicalPart();
680  bool ok = true;
681 
682  for (unsigned int i=0; i<tmp.size(); ++i) {
683  if (!strcmp(tmp[i].c_str(), log.name().name().c_str())) {
684  ok = false;
685  break;
686  }
687  }
688  if (ok) tmp.push_back(log.name().name());
689  dodet = fv.next();
690  }
691  return tmp;
692 }
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:92
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:90
void HCalSD::hitForFibre ( G4Step *  step,
double  weight 
)
private

Definition at line 828 of file HCalSD.cc.

References CaloSD::checkHit(), CaloSD::createNewHit(), CaloSD::currentHit, CaloSD::currentID, HLT_FULL_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().

828  { // if not ParamShower
829 
830  preStepPoint = aStep->GetPreStepPoint();
831  theTrack = aStep->GetTrack();
832  int primaryID = setTrackID(aStep);
833 
834  int det = 5;
835  std::vector<HFShower::Hit> hits = hfshower->getHits(aStep, weight);
836 
837  G4int particleCode = theTrack->GetDefinition()->GetPDGEncoding();
838  if (particleCode==emPDG || particleCode==epPDG || particleCode==gammaPDG) {
839  edepositEM = 1.*GeV;
840  edepositHAD = 0.;
841  } else {
842  edepositEM = 0.;
843  edepositHAD = 1.*GeV;
844  }
845 
846 #ifdef DebugLog
847  edm::LogInfo("HcalSim") << "HCalSD::hitForFibre " << hits.size()
848  << " hits for " << GetName() << " of " << primaryID
849  << " with " << theTrack->GetDefinition()->GetParticleName()
850  << " of " << preStepPoint->GetKineticEnergy()/GeV
851  << " GeV in detector type " << det;
852 #endif
853  if (hits.size() > 0) {
854  for (unsigned int i=0; i<hits.size(); ++i) {
855  G4ThreeVector hitPoint = hits[i].position;
856  if (isItinFidVolume (hitPoint)) {
857  int depth = hits[i].depth;
858  double time = hits[i].time;
859  unsigned int unitID = setDetUnitId(det, hitPoint, depth);
860  currentID.setID(unitID, time, primaryID, 0);
861 #ifdef plotDebug
862  plotProfile(aStep, hitPoint, edepositEM, time, depth);
863  bool emType = false;
864  if (particleCode==emPDG || particleCode==epPDG || particleCode==gammaPDG)
865  emType = true;
866  plotHF(hitPoint,emType);
867 #endif
868  // check if it is in the same unit and timeslice as the previous one
869  if (currentID == previousID) {
871  } else {
872  posGlobal = preStepPoint->GetPosition();
873  if (!checkHit()) currentHit = createNewHit();
874  }
875  }
876  }
877  }
878 }
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:748
virtual uint32_t setDetUnitId(G4Step *step)
Definition: HCalSD.cc:558
int setTrackID(G4Step *step)
Definition: HCalSD.cc:1051
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:1166
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:1119
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 603 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.

603  {
604  G4ParticleTable * theParticleTable = G4ParticleTable::GetParticleTable();
605  G4String particleName;
606  mumPDG = theParticleTable->FindParticle(particleName="mu-")->GetPDGEncoding();
607  mupPDG = theParticleTable->FindParticle(particleName="mu+")->GetPDGEncoding();
608 #ifdef DebugLog
609  LogDebug("HcalSim") << "HCalSD: Particle code for mu- = " << mumPDG
610  << " for mu+ = " << mupPDG;
611 #endif
612  if (showerLibrary) showerLibrary->initRun(theParticleTable,hcalConstants);
613  if (showerParam) showerParam->initRun(theParticleTable,hcalConstants);
614  if (hfshower) hfshower->initRun(theParticleTable,hcalConstants);
615  if (showerPMT) showerPMT->initRun(theParticleTable,hcalConstants);
616  if (showerBundle) showerBundle->initRun(theParticleTable,hcalConstants);
617 }
#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:97
void initRun(G4ParticleTable *, HcalDDDSimConstants *)
G4int mumPDG
Definition: HCalSD.h:97
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 736 of file HCalSD.cc.

References fibre2LV.

Referenced by ProcessHits().

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

Definition at line 712 of file HCalSD.cc.

References fibreLV.

Referenced by HCalSD(), and ProcessHits().

712  {
713  std::vector<G4LogicalVolume*>::const_iterator ite = fibreLV.begin();
714  for (; ite != fibreLV.end(); ++ite) if (lv == *ite) return true;
715  return false;
716 }
std::vector< G4LogicalVolume * > fibreLV
Definition: HCalSD.h:102
bool HCalSD::isItFibre ( G4String  name)
private

Definition at line 718 of file HCalSD.cc.

References fibreNames.

718  {
719  std::vector<G4String>::const_iterator it = fibreNames.begin();
720  for (; it != fibreNames.end(); ++it) if (name == *it) return true;
721  return false;
722 }
std::vector< G4String > fibreNames
Definition: HCalSD.h:100
bool HCalSD::isItHF ( G4Step *  aStep)
private

Definition at line 694 of file HCalSD.cc.

References hfLevels, hfLV, and hfNames.

Referenced by HCalSD(), and ProcessHits().

694  {
695  const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
696  int levels = (touch->GetHistoryDepth()) + 1;
697  for (unsigned int it=0; it < hfNames.size(); ++it) {
698  if (levels >= hfLevels[it]) {
699  G4LogicalVolume* lv = touch->GetVolume(levels-hfLevels[it])->GetLogicalVolume();
700  if (lv == hfLV[it]) return true;
701  }
702  }
703  return false;
704 }
std::vector< G4LogicalVolume * > hfLV
Definition: HCalSD.h:102
std::vector< int > hfLevels
Definition: HCalSD.h:99
std::vector< G4String > hfNames
Definition: HCalSD.h:100
bool HCalSD::isItHF ( G4String  name)
private

Definition at line 706 of file HCalSD.cc.

References hfNames.

706  {
707  std::vector<G4String>::const_iterator it = hfNames.begin();
708  for (; it != hfNames.end(); ++it) if (name == *it) return true;
709  return false;
710 }
std::vector< G4String > hfNames
Definition: HCalSD.h:100
bool HCalSD::isItinFidVolume ( G4ThreeVector &  hitPoint)
private

Definition at line 748 of file HCalSD.cc.

References applyFidCut, and HFFibreFiducial::PMTNumber().

Referenced by getFromLibrary(), and hitForFibre().

748  {
749  bool flag = true;
750  if (applyFidCut) {
751  int npmt = HFFibreFiducial:: PMTNumber(hitPoint);
752 #ifdef DebugLog
753  edm::LogInfo("HcalSim") << "HCalSD::isItinFidVolume:#PMT= " << npmt
754  << " for hit point " << hitPoint;
755 #endif
756  if (npmt <= 0) flag = false;
757  }
758 #ifdef DebugLog
759  edm::LogInfo("HcalSim") << "HCalSD::isItinFidVolume: point " << hitPoint
760  << " return flag " << flag;
761 #endif
762  return flag;
763 }
static int PMTNumber(const G4ThreeVector &pe_effect)
bool applyFidCut
Definition: HCalSD.h:94
bool HCalSD::isItPMT ( G4LogicalVolume *  lv)
private

Definition at line 724 of file HCalSD.cc.

References pmtLV.

Referenced by ProcessHits().

724  {
725  std::vector<G4LogicalVolume*>::const_iterator ite = pmtLV.begin();
726  for (; ite != pmtLV.end(); ++ite) if (lv == *ite) return true;
727  return false;
728 }
std::vector< G4LogicalVolume * > pmtLV
Definition: HCalSD.h:102
bool HCalSD::isItScintillator ( G4Material *  mat)
private

Definition at line 742 of file HCalSD.cc.

References materials.

Referenced by getEnergyDeposit().

742  {
743  std::vector<G4Material*>::const_iterator ite = materials.begin();
744  for (; ite != materials.end(); ++ite) if (mat == *ite) return true;
745  return false;
746 }
std::vector< G4Material * > materials
Definition: HCalSD.h:101
bool HCalSD::isItStraightBundle ( G4LogicalVolume *  lv)
private

Definition at line 730 of file HCalSD.cc.

References fibre1LV.

Referenced by ProcessHits().

730  {
731  std::vector<G4LogicalVolume*>::const_iterator ite = fibre1LV.begin();
732  for (; ite != fibre1LV.end(); ++ite) if (lv == *ite) return true;
733  return false;
734 }
std::vector< G4LogicalVolume * > fibre1LV
Definition: HCalSD.h:102
double HCalSD::layerWeight ( int  det,
const G4ThreeVector &  pos,
int  depth,
int  lay 
)
private

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

1097  {
1098 
1099  double wt = 1.;
1100  if (numberingFromDDD) {
1101  //get the ID's as eta, phi, depth, ... indices
1103  depth, lay);
1104  modifyDepth(tmp);
1105  uint32_t id = HcalTestNumbering::packHcalIndex(tmp.subdet, tmp.zside, 1,
1106  tmp.etaR, tmp.phis,tmp.lay);
1107  std::map<uint32_t,double>::const_iterator ite = layerWeights.find(id);
1108  if (ite != layerWeights.end()) wt = ite->second;
1109 #ifdef DebugLog
1110  edm::LogInfo("HcalSim") << "HCalSD::layerWeight: ID " << std::hex << id
1111  << std::dec << " (" << tmp.subdet << "/"
1112  << tmp.zside << "/1/" << tmp.etaR << "/"
1113  << tmp.phis << "/" << tmp.lay << ") Weight " <<wt;
1114 #endif
1115  }
1116  return wt;
1117 }
#define DebugLog
void modifyDepth(HcalNumberingFromDDD::HcalID &id)
Definition: HCalSD.cc:1175
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:103
HcalID unitID(int det, const CLHEP::Hep3Vector &pos, int depth, int lay=-1) const
void HCalSD::modifyDepth ( HcalNumberingFromDDD::HcalID id)
private

Definition at line 1175 of file HCalSD.cc.

References HLT_FULL_cff::depth, depth_, hcalConstants, HcalDDDSimConstants::maxHFDepth(), and testNumber.

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

1175  {
1176  if (id.subdet == 4) {
1177  int ieta = (id.zside == 0) ? -id.etaR : id.etaR;
1178  if (hcalConstants->maxHFDepth(ieta,id.phis) > 2) {
1179  if (id.depth <= 2) {
1180  if (G4UniformRand() > 0.5) id.depth += 2;
1181  }
1182  }
1183  } else if ((id.subdet == 1 || id.subdet ==2) && testNumber) {
1184  id.depth = depth_;
1185  }
1186 }
G4int depth_
Definition: HCalSD.h:97
bool testNumber
Definition: HCalSD.h:92
int maxHFDepth(int ieta, int iphi) const
HcalDDDSimConstants * hcalConstants
Definition: HCalSD.h:81
void HCalSD::plotHF ( G4ThreeVector &  pos,
bool  emType 
)
private

Definition at line 1166 of file HCalSD.cc.

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

Referenced by getFromLibrary(), and hitForFibre().

1166  {
1167  double zv = std::abs(hitPoint.z()) - gpar[4];
1168  if (emType) {
1169  if (hzvem != 0) hzvem->Fill(zv);
1170  } else {
1171  if (hzvhad != 0) hzvhad->Fill(zv);
1172  }
1173 }
std::vector< double > gpar
Definition: HCalSD.h:98
TH1F * hzvhad
Definition: HCalSD.h:104
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TH1F * hzvem
Definition: HCalSD.h:104
void HCalSD::plotProfile ( G4Step *  step,
const G4ThreeVector &  pos,
double  edep,
double  time,
int  id 
)
private

Definition at line 1119 of file HCalSD.cc.

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

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

1120  {
1121 
1122  const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
1123  static const G4String modName[8] = {"HEModule", "HVQF" , "HBModule", "MBAT",
1124  "MBBT" , "MBBTC", "MBBT_R1P", "MBBT_R1M"};
1125  G4ThreeVector local;
1126  bool found=false;
1127  double depth=-2000;
1128  int idx = 4;
1129  for (int n=0; n<touch->GetHistoryDepth(); ++n) {
1130  G4String name = touch->GetVolume(n)->GetName();
1131 #ifdef DebugLog
1132  LogDebug("HcalSim") << "plotProfile Depth " << n << " Name " << name;
1133 #endif
1134  for (unsigned int ii=0; ii<8; ++ii) {
1135  if (name == modName[ii]) {
1136  found = true;
1137  int dn = touch->GetHistoryDepth() - n;
1138  local = touch->GetHistory()->GetTransform(dn).TransformPoint(global);
1139  if (ii == 0) {depth = local.z() - 4006.5; idx = 1;}
1140  else if (ii == 1) {depth = local.z() + 825.0; idx = 3;}
1141  else if (ii == 2) {depth = local.x() - 1775.; idx = 0;}
1142  else {depth = local.y() + 15.; idx = 2;}
1143  break;
1144  }
1145  }
1146  if (found) break;
1147  }
1148  if (!found) depth = std::abs(global.z()) - 11500;
1149 #ifdef DebugLog
1150  LogDebug("HcalSim") << "plotProfile Found " << found << " Global " << global
1151  << " Local " << local << " depth " << depth << " ID "
1152  << id << " EDEP " << edep << " Time " << time;
1153 #endif
1154  if (hit_[idx] != 0) hit_[idx]->Fill(edep);
1155  if (time_[idx] != 0) time_[idx]->Fill(time,edep);
1156  if (dist_[idx] != 0) dist_[idx]->Fill(depth,edep);
1157  int jd = 2*idx + id - 7;
1158  if (jd >= 0 && jd < 4) {
1159  jd += 5;
1160  if (hit_[jd] != 0) hit_[jd]->Fill(edep);
1161  if (time_[jd] != 0) time_[jd]->Fill(time,edep);
1162  if (dist_[jd] != 0) dist_[jd]->Fill(depth,edep);
1163  }
1164 }
#define LogDebug(id)
TH1F * time_[9]
Definition: HCalSD.h:104
int ii
Definition: cuy.py:588
TH1F * hit_[9]
Definition: HCalSD.h:104
TH1F * dist_[9]
Definition: HCalSD.h:104
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool HCalSD::ProcessHits ( G4Step *  aStep,
G4TouchableHistory *   
)
virtual

Reimplemented from CaloSD.

Definition at line 374 of file HCalSD.cc.

References funct::abs(), CaloSD::createNewHit(), CaloSD::currentHit, HFDarkening::degradation(), deliveredLumi, depth_, 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, HFDarkening::lowZLimit, m_HFDarkening, mumPDG, mupPDG, SensitiveDetector::NaNTrap(), NULL, HFDarkening::numberOfZLayers, plotProfile(), alignCSCRings::r, showerBundle, showerPMT, HFDarkening::upperZLimit, useFibreBundle, useParam, usePMTHit, useShowerLibrary, histoStyle::weight, and z.

374  {
375 
376  NaNTrap( aStep ) ;
377 
378  if (aStep == NULL) {
379  return true;
380  } else {
381  depth_ = (aStep->GetPreStepPoint()->GetTouchable()->GetReplicaNumber(0))%10;
382  G4LogicalVolume* lv =
383  aStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume();
384  G4String nameVolume = lv->GetName();
385  if (isItHF(aStep)) {
386  G4int parCode = aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
387  double weight(1.0);
388  if (m_HFDarkening != 0) {
389  G4ThreeVector hitPoint = aStep->GetPreStepPoint()->GetPosition();
390  double r = hitPoint.perp()/CLHEP::cm;
391  double z = std::abs(hitPoint.z())/CLHEP::cm;
392  double dose_acquired = 0.;
394  unsigned int hfZLayer = (int)((z - HFDarkening::lowZLimit)/5);
395  if (hfZLayer >= HFDarkening::upperZLimit) hfZLayer = (HFDarkening::upperZLimit-1);
396  float normalized_lumi = m_HFDarkening->int_lumi(deliveredLumi);
397  for (int i = hfZLayer; i != HFDarkening::numberOfZLayers; ++i) {
398  dose_acquired = m_HFDarkening->dose(i,r);
399  weight *= m_HFDarkening->degradation(normalized_lumi*dose_acquired);
400  }
401  }
402 #ifdef DebugLog
403  LogDebug("HcalSim") << "HCalSD: HFLumiDarkening at r = " << r
404  << ", z = " << z << " Dose " << dose_acquired
405  << " weight " << weight;
406 #endif
407  }
408  if (useParam) {
409 #ifdef DebugLog
410  LogDebug("HcalSim") << "HCalSD: " << getNumberOfHits()
411  << " hits from parametrization in " << nameVolume
412  << " for Track " << aStep->GetTrack()->GetTrackID()
413  <<" (" << aStep->GetTrack()->GetDefinition()->GetParticleName()
414  <<")";
415 #endif
416  getFromParam(aStep, weight);
417 #ifdef DebugLog
418  LogDebug("HcalSim") << "HCalSD: " << getNumberOfHits()
419  << " hits afterParamS*";
420 #endif
421  } else {
422  bool notaMuon = true;
423  if (parCode == mupPDG || parCode == mumPDG ) notaMuon = false;
424  if (useShowerLibrary && notaMuon) {
425 #ifdef DebugLog
426  LogDebug("HcalSim") << "HCalSD: Starts shower library from "
427  << nameVolume << " for Track "
428  << aStep->GetTrack()->GetTrackID() << " ("
429  << aStep->GetTrack()->GetDefinition()->GetParticleName() << ")";
430 #endif
431  getFromLibrary(aStep, weight);
432  } else if (isItFibre(lv)) {
433 #ifdef DebugLog
434  LogDebug("HcalSim") << "HCalSD: Hit at Fibre in " << nameVolume
435  << " for Track "
436  << aStep->GetTrack()->GetTrackID() <<" ("
437  << aStep->GetTrack()->GetDefinition()->GetParticleName() << ")";
438 #endif
439  hitForFibre(aStep, weight);
440  }
441  }
442  } else if (isItPMT(lv)) {
443 #ifdef DebugLog
444  LogDebug("HcalSim") << "HCalSD: Hit from PMT parametrization from "
445  << nameVolume << " for Track "
446  << aStep->GetTrack()->GetTrackID() << " ("
447  << aStep->GetTrack()->GetDefinition()->GetParticleName() << ")";
448 #endif
449  if (usePMTHit && showerPMT) getHitPMT(aStep);
450  } else if (isItStraightBundle(lv) || isItConicalBundle(lv)) {
451 #ifdef DebugLog
452  LogDebug("HcalSim") << "HCalSD: Hit from FibreBundle from "
453  << nameVolume << " for Track "
454  << aStep->GetTrack()->GetTrackID() << " ("
455  << aStep->GetTrack()->GetDefinition()->GetParticleName() << ")";
456 #endif
459  } else {
460 #ifdef DebugLog
461  LogDebug("HcalSim") << "HCalSD: Hit from standard path from "
462  << nameVolume << " for Track "
463  << aStep->GetTrack()->GetTrackID() << " ("
464  << aStep->GetTrack()->GetDefinition()->GetParticleName() << ")";
465 #endif
466  if (getStepInfo(aStep)) {
467 #ifdef plotDebug
468  if (edepositEM+edepositHAD > 0)
469  plotProfile(aStep, aStep->GetPreStepPoint()->GetPosition(),
470  edepositEM+edepositHAD,aStep->GetPostStepPoint()->GetGlobalTime(),0);
471 #endif
472  if (hitExists() == false && edepositEM+edepositHAD>0.) currentHit = createNewHit();
473  }
474  }
475  return true;
476  }
477 }
#define LogDebug(id)
float edepositEM
Definition: CaloSD.h:121
int i
Definition: DBlmapReader.cc:9
bool useParam
Definition: HCalSD.h:94
void hitForFibre(G4Step *step, double weight)
Definition: HCalSD.cc:828
void getFromParam(G4Step *step, double weight)
Definition: HCalSD.cc:880
G4int depth_
Definition: HCalSD.h:97
bool isItStraightBundle(G4LogicalVolume *)
Definition: HCalSD.cc:730
double dose(unsigned int layer, double radius)
Definition: HFDarkening.cc:34
bool useFibreBundle
Definition: HCalSD.h:91
double deliveredLumi
Definition: HCalSD.h:96
HFShowerFibreBundle * showerBundle
Definition: HCalSD.h:88
bool useShowerLibrary
Definition: HCalSD.h:94
#define NULL
Definition: scimark2.h:8
void getFromLibrary(G4Step *step, double weight)
Definition: HCalSD.cc:765
bool usePMTHit
Definition: HCalSD.h:91
static const unsigned int numberOfZLayers
Definition: HFDarkening.h:26
double degradation(double mrad)
Definition: HFDarkening.cc:62
bool isItHF(G4Step *)
Definition: HCalSD.cc:694
double int_lumi(double intlumi)
Definition: HFDarkening.cc:66
bool isItConicalBundle(G4LogicalVolume *)
Definition: HCalSD.cc:736
float edepositHAD
Definition: CaloSD.h:121
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
void getHitPMT(G4Step *step)
Definition: HCalSD.cc:919
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:1119
void NaNTrap(G4Step *step)
virtual G4bool getStepInfo(G4Step *aStep)
Definition: CaloSD.cc:250
bool isItPMT(G4LogicalVolume *)
Definition: HCalSD.cc:724
G4int mupPDG
Definition: HCalSD.h:97
static const unsigned int lowZLimit
Definition: HFDarkening.h:29
static const unsigned int upperZLimit
Definition: HFDarkening.h:30
void getHitFibreBundle(G4Step *step, bool type)
Definition: HCalSD.cc:987
G4bool hitExists()
Definition: CaloSD.cc:310
G4int mumPDG
Definition: HCalSD.h:97
HFShowerPMT * showerPMT
Definition: HCalSD.h:87
int weight
Definition: histoStyle.py:50
CaloG4Hit * createNewHit()
Definition: CaloSD.cc:363
bool isItFibre(G4LogicalVolume *)
Definition: HCalSD.cc:712
void HCalSD::readWeightFromFile ( std::string  fName)
private

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

1071  {
1072 
1073  std::ifstream infile;
1074  int entry=0;
1075  infile.open(fName.c_str(), std::ios::in);
1076  if (infile) {
1077  int det, zside, etaR, phi, lay;
1078  double wt;
1079  while (infile >> det >> zside >> etaR >> phi >> lay >> wt) {
1080  uint32_t id = HcalTestNumbering::packHcalIndex(det,zside,1,etaR,phi,lay);
1081  layerWeights.insert(std::pair<uint32_t,double>(id,wt));
1082  ++entry;
1083 #ifdef DebugLog
1084  edm::LogInfo("HcalSim") << "HCalSD::readWeightFromFile:Entry " << entry
1085  << " ID " << std::hex << id << std::dec << " ("
1086  << det << "/" << zside << "/1/" << etaR << "/"
1087  << phi << "/" << lay << ") Weight " << wt;
1088 #endif
1089  }
1090  infile.close();
1091  }
1092  edm::LogInfo("HcalSim") << "HCalSD::readWeightFromFile: reads " << entry
1093  << " weights from " << fName;
1094  if (entry <= 0) useLayerWt = false;
1095 }
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:103
uint32_t HCalSD::setDetUnitId ( G4Step *  step)
virtual

Implements CaloSD.

Definition at line 558 of file HCalSD.cc.

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

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

558  {
559 
560  G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
561  const G4VTouchable* touch = preStepPoint->GetTouchable();
562  G4ThreeVector hitPoint = preStepPoint->GetPosition();
563 
564  int depth = (touch->GetReplicaNumber(0))%10 + 1;
565  int lay = (touch->GetReplicaNumber(0)/10)%100 + 1;
566  int det = (touch->GetReplicaNumber(1))/1000;
567 
568  return setDetUnitId (det, hitPoint, depth, lay);
569 }
virtual uint32_t setDetUnitId(G4Step *step)
Definition: HCalSD.cc:558
G4StepPoint * preStepPoint
Definition: CaloSD.h:120
uint32_t HCalSD::setDetUnitId ( int  det,
const G4ThreeVector &  pos,
int  depth,
int  lay = 1 
)
private

Definition at line 637 of file HCalSD.cc.

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

637  {
638  uint32_t id = 0;
639  if (numberingFromDDD) {
640  //get the ID's as eta, phi, depth, ... indices
642  modifyDepth(tmp);
643  //get the ID
644  if (numberingScheme) id = numberingScheme->getUnitID(tmp);
645  }
646  return id;
647 }
virtual uint32_t getUnitID(const HcalNumberingFromDDD::HcalID &id)
void modifyDepth(HcalNumberingFromDDD::HcalID &id)
Definition: HCalSD.cc:1175
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 571 of file HCalSD.cc.

References numberingScheme.

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

571  {
572  if (scheme != 0) {
573  edm::LogInfo("HcalSim") << "HCalSD: updates numbering scheme for " << GetName();
574  if (numberingScheme) delete numberingScheme;
575  numberingScheme = scheme;
576  }
577 }
HcalNumberingScheme * numberingScheme
Definition: HCalSD.h:83
int HCalSD::setTrackID ( G4Step *  step)
private

Definition at line 1051 of file HCalSD.cc.

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

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

1051  {
1052  theTrack = aStep->GetTrack();
1053 
1054  double etrack = preStepPoint->GetKineticEnergy();
1055  TrackInformation * trkInfo = (TrackInformation *)(theTrack->GetUserInformation());
1056  int primaryID = trkInfo->getIDonCaloSurface();
1057  if (primaryID == 0) {
1058 #ifdef DebugLog
1059  edm::LogInfo("HcalSim") << "HCalSD: Problem with primaryID **** set by "
1060  << "force to TkID **** " <<theTrack->GetTrackID();
1061 #endif
1062  primaryID = theTrack->GetTrackID();
1063  }
1064 
1065  if (primaryID != previousID.trackID())
1066  resetForNewPrimary(preStepPoint->GetPosition(), etrack);
1067 
1068  return primaryID;
1069 }
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 579 of file HCalSD.cc.

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

579  {
580 
581  const edm::EventSetup* es = (*job)();
583  es->get<HcalSimNumberingRecord>().get(hdc);
584  if (hdc.isValid()) {
585  hcalConstants = (HcalDDDSimConstants*)(&(*hdc));
586  } else {
587  edm::LogError("HcalSim") << "HCalSD : Cannot find HcalDDDSimConstant";
588  throw cms::Exception("Unknown", "HCalSD") << "Cannot find HcalDDDSimConstant" << "\n";
589  }
590 
592 
593  edm::LogInfo("HcalSim") << "Maximum depth for HF " << hcalConstants->getMaxDepth(2);
594 
595  //Special Geometry parameters
597  edm::LogInfo("HcalSim") << "HCalSD: " << gpar.size()<< " gpar (cm)";
598  for (unsigned int ig=0; ig<gpar.size(); ig++)
599  edm::LogInfo("HcalSim") << "HCalSD: gpar[" << ig << "] = "
600  << gpar[ig]/cm << " cm";
601 }
std::vector< double > gpar
Definition: HCalSD.h:98
int getMaxDepth(const int type) 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 94 of file HCalSD.h.

Referenced by HCalSD(), and isItinFidVolume().

double HCalSD::betaThr
private

Definition at line 93 of file HCalSD.h.

Referenced by HCalSD().

double HCalSD::birk1
private

Definition at line 93 of file HCalSD.h.

Referenced by getEnergyDeposit(), and HCalSD().

double HCalSD::birk2
private

Definition at line 93 of file HCalSD.h.

Referenced by getEnergyDeposit(), and HCalSD().

double HCalSD::birk3
private

Definition at line 93 of file HCalSD.h.

Referenced by getEnergyDeposit(), and HCalSD().

double HCalSD::deliveredLumi
private

Definition at line 96 of file HCalSD.h.

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

G4int HCalSD::depth_
private

Definition at line 97 of file HCalSD.h.

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

TH1F * HCalSD::dist_[9]
private

Definition at line 104 of file HCalSD.h.

Referenced by HCalSD(), and plotProfile().

double HCalSD::eminHitHB
private

Definition at line 95 of file HCalSD.h.

Referenced by filterHit(), and HCalSD().

double HCalSD::eminHitHE
private

Definition at line 95 of file HCalSD.h.

Referenced by filterHit(), and HCalSD().

double HCalSD::eminHitHF
private

Definition at line 95 of file HCalSD.h.

Referenced by filterHit(), and HCalSD().

double HCalSD::eminHitHO
private

Definition at line 95 of file HCalSD.h.

Referenced by filterHit(), and HCalSD().

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

Definition at line 102 of file HCalSD.h.

Referenced by HCalSD(), and isItStraightBundle().

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

Definition at line 102 of file HCalSD.h.

Referenced by HCalSD(), and isItConicalBundle().

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

Definition at line 102 of file HCalSD.h.

Referenced by HCalSD(), and isItFibre().

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

Definition at line 100 of file HCalSD.h.

Referenced by HCalSD(), and isItFibre().

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

Definition at line 98 of file HCalSD.h.

Referenced by plotHF(), and update().

HcalDDDSimConstants* HCalSD::hcalConstants
private

Definition at line 81 of file HCalSD.h.

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

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

Definition at line 99 of file HCalSD.h.

Referenced by HCalSD(), and isItHF().

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

Definition at line 102 of file HCalSD.h.

Referenced by HCalSD(), and isItHF().

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

Definition at line 100 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 104 of file HCalSD.h.

Referenced by HCalSD(), and plotProfile().

TH1F * HCalSD::hzvem
private

Definition at line 104 of file HCalSD.h.

Referenced by HCalSD(), and plotHF().

TH1F * HCalSD::hzvhad
private

Definition at line 104 of file HCalSD.h.

Referenced by HCalSD(), and plotHF().

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

Definition at line 103 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 101 of file HCalSD.h.

Referenced by HCalSD(), and isItScintillator().

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

Definition at line 100 of file HCalSD.h.

Referenced by HCalSD().

G4int HCalSD::mumPDG
private

Definition at line 97 of file HCalSD.h.

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

G4int HCalSD::mupPDG
private

Definition at line 97 of file HCalSD.h.

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

bool HCalSD::neutralDensity
private

Definition at line 92 of file HCalSD.h.

Referenced by getEnergyDeposit(), and HCalSD().

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 102 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 92 of file HCalSD.h.

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

TH1F * HCalSD::time_[9]
private

Definition at line 104 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 94 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 94 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 94 of file HCalSD.h.

Referenced by HCalSD(), and ProcessHits().