CMS 3D CMS Logo

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

#include <FastHFShowerLibrary.h>

Public Member Functions

 FastHFShowerLibrary (edm::ParameterSet const &p)
 
const std::map< CaloHitID,
float > & 
getHitsMap ()
 
void const initHFShowerLibrary (const edm::EventSetup &)
 
void recoHFShowerLibrary (const FSimTrack &myTrack)
 
 ~FastHFShowerLibrary ()
 

Private Attributes

bool applyFidCut
 
const edm::ParameterSet fast
 
std::unique_ptr< HFShowerLibraryhfshower
 
std::map< CaloHitID, float > hitMap
 
std::string name
 
std::unique_ptr
< HcalNumberingFromDDD
numberingFromDDD
 
HcalNumberingScheme numberingScheme
 

Detailed Description

Definition at line 39 of file FastHFShowerLibrary.h.

Constructor & Destructor Documentation

FastHFShowerLibrary::FastHFShowerLibrary ( edm::ParameterSet const &  p)

Definition at line 37 of file FastHFShowerLibrary.cc.

References applyFidCut, and edm::ParameterSet::getParameter().

38  : fast(p) {
39  edm::ParameterSet m_HS = p.getParameter<edm::ParameterSet>("HFShowerLibrary");
40  applyFidCut = m_HS.getParameter<bool>("ApplyFiducialCut");
41 }
T getParameter(std::string const &) const
const edm::ParameterSet fast
FastHFShowerLibrary::~FastHFShowerLibrary ( )
inline

Definition at line 45 of file FastHFShowerLibrary.h.

45 {;}

Member Function Documentation

const std::map<CaloHitID,float>& FastHFShowerLibrary::getHitsMap ( )
inline

Definition at line 52 of file FastHFShowerLibrary.h.

References hitMap.

Referenced by CalorimetryManager::HDShowerSimulation(), and CalorimetryManager::reconstruct().

52 { return hitMap; };
std::map< CaloHitID, float > hitMap
void const FastHFShowerLibrary::initHFShowerLibrary ( const edm::EventSetup iSetup)

Definition at line 43 of file FastHFShowerLibrary.cc.

References fast, edm::EventSetup::get(), hfshower, name, numberingFromDDD, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by FamosManager::setupGeometryAndField().

43  {
44 
45  edm::LogInfo("FastCalorimetry") << "initHFShowerLibrary::initialization";
46 
48  iSetup.get<IdealGeometryRecord>().get(cpv);
49 
51  iSetup.get<HcalSimNumberingRecord>().get(hdc);
52  HcalDDDSimConstants *hcalConstants = (HcalDDDSimConstants*)(&(*hdc));
53 
54  std::string name = "HcalHits";
55  numberingFromDDD.reset(new HcalNumberingFromDDD(hcalConstants));
56  hfshower.reset(new HFShowerLibrary(name,*cpv,fast));
57 
58  // Geant4 particles
59  G4DecayPhysics decays;
60  decays.ConstructParticle();
61  G4ParticleTable* partTable = G4ParticleTable::GetParticleTable();
62  partTable->SetReadiness();
63 
64  hfshower->initRun(partTable, hcalConstants); // init particle code
65 }
const edm::ParameterSet fast
std::unique_ptr< HcalNumberingFromDDD > numberingFromDDD
const T & get() const
Definition: EventSetup.h:56
std::unique_ptr< HFShowerLibrary > hfshower
void FastHFShowerLibrary::recoHFShowerLibrary ( const FSimTrack myTrack)

Definition at line 67 of file FastHFShowerLibrary.cc.

References applyFidCut, HLT_25ns14e33_v1_cff::depth, HcalNumberingScheme::getUnitID(), hfshower, hitMap, i, FSimTrack::id(), numberingFromDDD, numberingScheme, convertSQLiteXML::ok, FSimTrack::onVFcal(), HFFibreFiducial::PMTNumber(), cond::rpcobgas::time, tmp, CoreSimTrack::type(), RawParticle::vertex(), FSimTrack::vfcalEntrance(), puppiForMET_cff::weight, RawParticle::X(), RawParticle::Y(), and RawParticle::Z().

Referenced by CalorimetryManager::HDShowerSimulation(), and CalorimetryManager::reconstruct().

67  {
68 
69 #ifdef DebugLog
70  edm::LogInfo("FastCalorimetry") << "FastHFShowerLibrary: recoHFShowerLibrary ";
71 #endif
72 
73  if(!myTrack.onVFcal()) {
74 #ifdef DebugLog
75  edm::LogInfo("FastCalorimetry") << "FastHFShowerLibrary: we should not be here ";
76 #endif
77  }
78 
79  hitMap.clear();
80  double eGen = 1000.*myTrack.vfcalEntrance().e(); // energy in [MeV]
81  double delZv = (myTrack.vfcalEntrance().vertex().Z()>0.0) ? 50.0 : -50.0;
82  G4ThreeVector vertex( 10.*myTrack.vfcalEntrance().vertex().X(),
83  10.*myTrack.vfcalEntrance().vertex().Y(),
84  10.*myTrack.vfcalEntrance().vertex().Z()+delZv); // in [mm]
85 
86  G4ThreeVector direction(myTrack.vfcalEntrance().Vect().X(),
87  myTrack.vfcalEntrance().Vect().Y(),
88  myTrack.vfcalEntrance().Vect().Z());
89 
90  bool ok;
91  double weight = 1.0; // rad. damage
92  int parCode = myTrack.type();
93  double tSlice = 0.1*vertex.mag()/29.98;
94 
95  std::vector<HFShowerLibrary::Hit> hits =
96  hfshower->fillHits(vertex,direction,parCode,eGen,ok,weight,false,tSlice);
97 
98  for (unsigned int i=0; i<hits.size(); ++i) {
99  G4ThreeVector pos = hits[i].position;
100  int depth = hits[i].depth;
101  double time = hits[i].time;
102  if (!applyFidCut || (HFFibreFiducial::PMTNumber(pos)>0) ) {
103 // if (!applyFidCut || (applyFidCut && HFFibreFiducial::PMTNumber(pos)>0)) {
104  int det = 5;
105  int lay = 1;
106  uint32_t id = 0;
107  HcalNumberingFromDDD::HcalID tmp = numberingFromDDD->unitID(det, pos, depth, lay);
108  id = numberingScheme.getUnitID(tmp);
109 
110  CaloHitID current_id(id,time,myTrack.id());
111  std::map<CaloHitID,float>::iterator cellitr;
112  cellitr = hitMap.find(current_id);
113  if(cellitr==hitMap.end()) {
114  hitMap.insert(std::pair<CaloHitID,float>(current_id,1.0));
115  } else {
116  cellitr->second += 1.0;
117  }
118  } // end of isItinFidVolume check
119  } // end loop over hits
120 
121 }
int i
Definition: DBlmapReader.cc:9
const RawParticle & vfcalEntrance() const
The particle at VFCAL entrance.
Definition: FSimTrack.h:139
virtual uint32_t getUnitID(const HcalNumberingFromDDD::HcalID &id)
static int PMTNumber(const G4ThreeVector &pe_effect)
HcalNumberingScheme numberingScheme
double Y() const
y of vertex
Definition: RawParticle.h:275
double Z() const
z of vertex
Definition: RawParticle.h:276
int onVFcal() const
Definition: FSimTrack.h:111
std::unique_ptr< HcalNumberingFromDDD > numberingFromDDD
const XYZTLorentzVector & vertex() const
the vertex fourvector
Definition: RawParticle.h:285
double X() const
x of vertex
Definition: RawParticle.h:274
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
int type() const
particle type (HEP PDT convension)
Definition: CoreSimTrack.h:25
std::unique_ptr< HFShowerLibrary > hfshower
int id() const
the index in FBaseSimEvent and other vectors
Definition: FSimTrack.h:86
std::map< CaloHitID, float > hitMap

Member Data Documentation

bool FastHFShowerLibrary::applyFidCut
private

Definition at line 63 of file FastHFShowerLibrary.h.

Referenced by FastHFShowerLibrary(), and recoHFShowerLibrary().

const edm::ParameterSet FastHFShowerLibrary::fast
private

Definition at line 52 of file FastHFShowerLibrary.h.

Referenced by initHFShowerLibrary().

std::unique_ptr<HFShowerLibrary> FastHFShowerLibrary::hfshower
private

Definition at line 57 of file FastHFShowerLibrary.h.

Referenced by initHFShowerLibrary(), and recoHFShowerLibrary().

std::map<CaloHitID,float> FastHFShowerLibrary::hitMap
private

Definition at line 61 of file FastHFShowerLibrary.h.

Referenced by getHitsMap(), and recoHFShowerLibrary().

std::string FastHFShowerLibrary::name
private

Definition at line 64 of file FastHFShowerLibrary.h.

Referenced by ElectronMVAID.ElectronMVAID::__call__(), dirstructure.Directory::__create_pie_image(), dqm_interfaces.DirID::__eq__(), dirstructure.Directory::__get_full_path(), dirstructure.Comparison::__get_img_name(), dataset.Dataset::__getDataType(), dataset.Dataset::__getFileInfoList(), cuy.divideElement::__init__(), cuy.plotElement::__init__(), cuy.additionElement::__init__(), cuy.superimposeElement::__init__(), cuy.graphElement::__init__(), dirstructure.Comparison::__make_image(), core.autovars.NTupleVariable::__repr__(), core.autovars.NTupleObjectType::__repr__(), core.autovars.NTupleObject::__repr__(), core.autovars.NTupleCollection::__repr__(), dirstructure.Directory::__repr__(), dqm_interfaces.DirID::__repr__(), dirstructure.Comparison::__repr__(), config.CFG::__str__(), counter.Counter::__str__(), average.Average::__str__(), core.autovars.NTupleObjectType::addSubObjects(), core.autovars.NTupleObjectType::addVariables(), core.autovars.NTupleObjectType::allVars(), dirstructure.Directory::calcStats(), validation.Sample::digest(), python.rootplot.utilities.Hist::divide(), python.rootplot.utilities.Hist::divide_wilson(), TreeCrawler.Package::dump(), core.autovars.NTupleVariable::fillBranch(), core.autovars.NTupleObject::fillBranches(), core.autovars.NTupleCollection::fillBranchesScalar(), core.autovars.NTupleCollection::fillBranchesVector(), core.autovars.NTupleCollection::get_cpp_declaration(), core.autovars.NTupleCollection::get_cpp_wrapper_class(), core.autovars.NTupleCollection::get_py_wrapper_class(), utils.StatisticalTest::get_status(), production_tasks.Task::getname(), dataset.CMSDataset::getPrimaryDatasetEntries(), dataset.PrivateDataset::getPrimaryDatasetEntries(), initHFShowerLibrary(), VIDSelectorBase.VIDSelectorBase::initialize(), core.autovars.NTupleVariable::makeBranch(), core.autovars.NTupleObject::makeBranches(), core.autovars.NTupleCollection::makeBranchesScalar(), core.autovars.NTupleCollection::makeBranchesVector(), dirstructure.Directory::print_report(), dataset.BaseDataset::printInfo(), dataset.Dataset::printInfo(), production_tasks.MonitorJobs::run(), python.rootplot.utilities.Hist::TGraph(), python.rootplot.utilities.Hist::TH1F(), Vispa.Views.PropertyView.Property::valueChanged(), counter.Counter::write(), and average.Average::write().

std::unique_ptr<HcalNumberingFromDDD> FastHFShowerLibrary::numberingFromDDD
private

Definition at line 58 of file FastHFShowerLibrary.h.

Referenced by initHFShowerLibrary(), and recoHFShowerLibrary().

HcalNumberingScheme FastHFShowerLibrary::numberingScheme
private

Definition at line 59 of file FastHFShowerLibrary.h.

Referenced by recoHFShowerLibrary().