#include <SimCalorimetry/HcalTrigPrimProducers/src/HcalDummyHitProducer.h>
Public Types | |
typedef std::multimap < HcalTrigTowerDetId, HcalDetId > | tid2cid |
Public Member Functions | |
HcalDummyHitProducer (const edm::ParameterSet &ps) | |
virtual void | produce (edm::Event &e, const edm::EventSetup &c) |
Produces the EDM products,. | |
virtual | ~HcalDummyHitProducer () |
Private Attributes | |
double | energyEM |
double | energyHad |
double | step_size |
HcalTrigTowerGeometry | theTrigTowerGeometry |
tid2cid | Tower_map |
Definition at line 17 of file HcalDummyHitProducer.h.
typedef std::multimap<HcalTrigTowerDetId, HcalDetId> HcalDummyHitProducer::tid2cid |
Definition at line 21 of file HcalDummyHitProducer.h.
HcalDummyHitProducer::HcalDummyHitProducer | ( | const edm::ParameterSet & | ps | ) | [explicit] |
Definition at line 17 of file HcalDummyHitProducer.cc.
References energyEM, energyHad, edm::ParameterSet::getParameter(), and step_size.
00018 { 00019 energyEM = 0; 00020 produces<edm::PCaloHitContainer>("HcalHits"); 00021 step_size = ps.getParameter<double>("step_size"); 00022 energyHad = ps.getParameter<double>("energy_start"); 00023 }
HcalDummyHitProducer::~HcalDummyHitProducer | ( | ) | [virtual] |
void HcalDummyHitProducer::produce | ( | edm::Event & | e, | |
const edm::EventSetup & | c | |||
) | [virtual] |
Produces the EDM products,.
Implements edm::EDProducer.
Definition at line 78 of file HcalDummyHitProducer.cc.
References calib, HcalDetId::depth(), energyHad, edm::EventSetup::get(), DetId::Hcal, HcalBarrel, HcalEndcap, HcalForward, int, n, edm::Event::put(), DetId::rawId(), HLT_VtxMuL3::result, sample_factor(), step_size, theTrigTowerGeometry, Tower_map, and HcalTrigTowerGeometry::towerIds().
00078 { 00079 // get the appropriate gains, noises, & widths for this event 00080 //edm::ESHandle<HcalDbService> conditions; 00081 //eventSetup.get<HcalDbRecord>().get(conditions); 00082 //theParameters->setDbService(conditions.product()); 00083 00084 std::auto_ptr<edm::PCaloHitContainer> result(new edm::PCaloHitContainer); 00085 // get the correct geometry 00086 edm::ESHandle<CaloGeometry> geometry; 00087 eventSetup.get<CaloGeometryRecord>().get(geometry); 00088 vector<DetId> hbCells = geometry->getValidDetIds(DetId::Hcal, HcalBarrel); 00089 vector<DetId> heCells = geometry->getValidDetIds(DetId::Hcal, HcalEndcap); 00090 vector<DetId> hfCells = geometry->getValidDetIds(DetId::Hcal, HcalForward); 00091 00092 vector<HcalTrigTowerDetId> towerids; 00093 Tower_map.clear(); 00094 for(vector<DetId>::const_iterator itr = hbCells.begin(); itr != hbCells.end(); ++itr) 00095 { 00096 HcalDetId barrelId(*itr); 00097 towerids = theTrigTowerGeometry.towerIds(barrelId); 00098 for(unsigned int n = 0; n < towerids.size(); ++n) 00099 { 00100 Tower_map.insert(tid2cid::value_type(towerids[n],barrelId)); 00101 } 00102 } 00103 for(vector<DetId>::const_iterator itr = heCells.begin(); itr != heCells.end(); ++itr) 00104 { 00105 HcalDetId endcapId(*itr); 00106 towerids = theTrigTowerGeometry.towerIds(endcapId); 00107 for(unsigned int n = 0; n < towerids.size(); ++n) 00108 { 00109 Tower_map.insert(tid2cid::value_type(towerids[n],endcapId)); 00110 } 00111 } 00112 for(vector<DetId>::const_iterator itr = hfCells.begin(); itr != hfCells.end(); ++itr) 00113 { 00114 HcalDetId forwardId(*itr); 00115 towerids = theTrigTowerGeometry.towerIds(forwardId); 00116 for(unsigned int n = 0; n < towerids.size(); ++n) 00117 { 00118 Tower_map.insert(tid2cid::value_type(towerids[n],forwardId)); 00119 } 00120 } 00121 00122 double time; 00123 double calib; 00124 int ncells; 00125 int ntowers; 00126 double cell_energyEM, cell_energyHad; 00127 00128 for(vector<DetId>::const_iterator itr = hbCells.begin(); itr != hbCells.end(); ++itr) 00129 { 00130 HcalDetId barrelId(*itr); 00131 //const CaloSimParameters & parameters = theParameterMap->simParameters(*itr); 00132 //calib = parameters.simHitToPhotoelectrons() 00133 // * parameters.photoelectronsToAnalog() 00134 // * theParameters->fCtoGeV(*itr); 00135 //time = 8.4 - parameters.timePhase(); 00136 calib = sample_factor(barrelId); 00137 time = 8.4; 00138 towerids = theTrigTowerGeometry.towerIds(barrelId); 00139 ncells = Tower_map.count(towerids[0]); 00140 ntowers = towerids.size(); 00141 cell_energyEM = 0; 00142 //cell_energyHad= (energyHad*ntowers)/(ncells*calib); 00143 if(barrelId.depth()==1) 00144 { 00145 cell_energyHad= (energyHad*ntowers)/(calib); 00146 } 00147 else 00148 { 00149 cell_energyHad = 0; 00150 } 00151 PCaloHit barrelHit(barrelId.rawId(), cell_energyEM, cell_energyHad, time, 0); 00152 result->push_back(barrelHit); 00153 } 00154 for(vector<DetId>::const_iterator itr = heCells.begin(); itr != heCells.end(); ++itr) 00155 { 00156 HcalDetId endcapId(*itr); 00157 //const CaloSimParameters & parameters = theParameterMap->simParameters(*itr); 00158 //calib = parameters.simHitToPhotoelectrons() 00159 //* parameters.photoelectronsToAnalog() 00160 //* theParameters->fCtoGeV(*itr); 00161 //time = 13.0 - parameters.timePhase(); 00162 calib = sample_factor(endcapId); 00163 time = 13.0; 00164 towerids = theTrigTowerGeometry.towerIds(endcapId); 00165 ncells = Tower_map.count(towerids[0]); 00166 ntowers = towerids.size(); 00167 cell_energyEM = 0; 00168 //cell_energyHad= (energyHad*ntowers)/(ncells*calib); 00169 if(endcapId.depth()==1) 00170 { 00171 cell_energyHad= (energyHad*ntowers)/(calib); 00172 } 00173 else 00174 { 00175 cell_energyHad = 0; 00176 } 00177 PCaloHit endcapHit(endcapId.rawId(), cell_energyEM, cell_energyHad, time, 0); 00178 result->push_back(endcapHit); 00179 } 00180 for(vector<DetId>::const_iterator itr = hfCells.begin(); itr != hfCells.end(); ++itr) 00181 { 00182 HcalDetId forwardId(*itr); 00183 //const CaloSimParameters & parameters = theParameterMap->simParameters(*itr); 00184 //calib = parameters.simHitToPhotoelectrons() 00185 //* parameters.photoelectronsToAnalog() 00186 //* theParameters->fCtoGeV(*itr); 00187 //time = 37.0 - parameters.timePhase(); 00188 calib = sample_factor(forwardId); 00189 time = 37.0; 00190 towerids = theTrigTowerGeometry.towerIds(forwardId); 00191 ncells = Tower_map.count(towerids[0]); 00192 ntowers = towerids.size(); 00193 cell_energyEM = 0; 00194 //cell_energyHad= (energyHad*ntowers)/(ncells*calib); 00195 if(forwardId.depth()==1) 00196 { 00197 cell_energyHad= (int)((energyHad)/(calib)); 00198 } 00199 else 00200 { 00201 cell_energyHad = 0; 00202 } 00203 00204 PCaloHit forwardHit(forwardId.rawId(), cell_energyEM, cell_energyHad, time, 0); 00205 result->push_back(forwardHit); 00206 } 00207 e.put(result,"HcalHits"); 00208 energyHad += step_size; 00209 }
double HcalDummyHitProducer::energyEM [private] |
double HcalDummyHitProducer::energyHad [private] |
Definition at line 32 of file HcalDummyHitProducer.h.
Referenced by HcalDummyHitProducer(), and produce().
double HcalDummyHitProducer::step_size [private] |
Definition at line 33 of file HcalDummyHitProducer.h.
Referenced by HcalDummyHitProducer(), and produce().
tid2cid HcalDummyHitProducer::Tower_map [private] |