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 34 of file FastHFShowerLibrary.cc.

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

35  : fast(p)
36 {
37  edm::ParameterSet m_HS = p.getParameter<edm::ParameterSet>("HFShowerLibrary");
38  applyFidCut = m_HS.getParameter<bool>("ApplyFiducialCut");
39 }
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 41 of file FastHFShowerLibrary.cc.

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

Referenced by FamosManager::setupGeometryAndField().

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

Definition at line 61 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(), histoStyle::weight, RawParticle::X(), RawParticle::Y(), and RawParticle::Z().

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

61  {
62 
63 #ifdef DebugLog
64  edm::LogInfo("FastCalorimetry") << "FastHFShowerLibrary: recoHFShowerLibrary ";
65 #endif
66 
67  if(!myTrack.onVFcal()) {
68 #ifdef DebugLog
69  edm::LogInfo("FastCalorimetry") << "FastHFShowerLibrary: we should not be here ";
70 #endif
71  }
72 
73  hitMap.clear();
74  double eGen = 1000.*myTrack.vfcalEntrance().e(); // energy in [MeV]
75  double delZv = (myTrack.vfcalEntrance().vertex().Z()>0.0) ? 50.0 : -50.0;
76  G4ThreeVector vertex( 10.*myTrack.vfcalEntrance().vertex().X(),
77  10.*myTrack.vfcalEntrance().vertex().Y(),
78  10.*myTrack.vfcalEntrance().vertex().Z()+delZv); // in [mm]
79 
80  G4ThreeVector direction(myTrack.vfcalEntrance().Vect().X(),
81  myTrack.vfcalEntrance().Vect().Y(),
82  myTrack.vfcalEntrance().Vect().Z());
83 
84  bool ok;
85  double weight = 1.0; // rad. damage
86  int parCode = myTrack.type();
87  double tSlice = 0.1*vertex.mag()/29.98;
88 
89  std::vector<HFShowerLibrary::Hit> hits =
90  hfshower->fillHits(vertex,direction,parCode,eGen,ok,weight,false,tSlice);
91 
92  for (unsigned int i=0; i<hits.size(); ++i) {
93  G4ThreeVector pos = hits[i].position;
94  int depth = hits[i].depth;
95  double time = hits[i].time;
96  if (!applyFidCut || (HFFibreFiducial::PMTNumber(pos)>0) ) {
97 // if (!applyFidCut || (applyFidCut && HFFibreFiducial::PMTNumber(pos)>0)) {
98  int det = 5;
99  int lay = 1;
100  uint32_t id = 0;
101  HcalNumberingFromDDD::HcalID tmp = numberingFromDDD->unitID(det, pos, depth, lay);
102  id = numberingScheme.getUnitID(tmp);
103 
104  CaloHitID current_id(id,time,myTrack.id());
105  std::map<CaloHitID,float>::iterator cellitr;
106  cellitr = hitMap.find(current_id);
107  if(cellitr==hitMap.end()) {
108  hitMap.insert(std::pair<CaloHitID,float>(current_id,1.0));
109  } else {
110  cellitr->second += 1.0;
111  }
112  } // end of isItinFidVolume check
113  } // end loop over hits
114 
115 }
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
int weight
Definition: histoStyle.py:50
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::allVars(), dirstructure.Directory::calcStats(), 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(), initHFShowerLibrary(), VIDSelectorBase.VIDSelectorBase::initialize(), core.autovars.NTupleVariable::makeBranch(), core.autovars.NTupleObject::makeBranches(), core.autovars.NTupleCollection::makeBranchesScalar(), core.autovars.NTupleCollection::makeBranchesVector(), dirstructure.Directory::print_report(), 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().