97 std::ifstream
infile(cfile);
98 if (!infile.is_open()) {
101 <<
"' for the correction file";
103 unsigned int ndets(0), nrec(0);
107 infile >>
id >> cfac;
108 if (!infile.good())
break;
111 std::map<DetId,double>::iterator itr =
corrFactor_.find(detId);
118 edm::LogInfo(
"AnalyzerMB") <<
"Reads " << nrec <<
" correction factors for "
119 << ndets <<
" detIds";
125 <<
" (IgnoreL1): " << ignoreL1 <<
" (NZS) "
126 << runNZS_ <<
" and with " << ieta.size()
127 <<
" detId for full histogram";
128 edm::LogInfo(
"AnalyzerMB") <<
"Thresholds for HB " << eLowHB_ <<
":"
129 << eHighHB_ <<
" for HE " << eLowHE_ <<
":"
130 << eHighHE_ <<
" for HF " << eLowHF_ <<
":"
132 for (
unsigned int k=0;
k<ieta.size(); ++
k) {
137 unsigned int id = (
HcalDetId(subd,ieta[k],iphi[k],depth[k])).rawId();
147 for (
unsigned int i=0;
i<
hcalID.size();
i++) {
149 int subdet =
id.subdetId();
150 sprintf (
name,
"%s%d_%d_%d", hc[subdet].c_str(),
id.
ieta(),
id.
iphi(),
id.
depth());
151 sprintf (
title,
"Energy Distribution for %s ieta %d iphi %d depth %d", hc[subdet].c_str(),
id.
ieta(),
id.
iphi(),
id.
depth());
152 double xmin = (subdet == 4) ? -10 : -1;
153 double xmax = (subdet == 4) ? 90 : 9;
154 TH1D* hh =
new TH1D(
name,
title, 50, xmin, xmax);
159 myTree =
new TTree(
"RecJet",
"RecJet Tree");
160 myTree->Branch(
"cells", &
cells,
"cells/I");
161 myTree->Branch(
"mysubd", &
mysubd,
"mysubd/I");
162 myTree->Branch(
"depth", &
depth,
"depth/I");
163 myTree->Branch(
"ieta", &
ieta,
"ieta/I");
164 myTree->Branch(
"iphi", &
iphi,
"iphi/I");
165 myTree->Branch(
"mom0_MB", &
mom0_MB,
"mom0_MB/F");
166 myTree->Branch(
"mom1_MB", &
mom1_MB,
"mom1_MB/F");
167 myTree->Branch(
"mom2_MB", &
mom2_MB,
"mom2_MB/F");
168 myTree->Branch(
"mom3_MB", &
mom2_MB,
"mom3_MB/F");
169 myTree->Branch(
"mom4_MB", &
mom4_MB,
"mom4_MB/F");
170 myTree->Branch(
"trigbit", &
trigbit,
"trigbit/I");
171 myTree->Branch(
"rnnumber", &
rnnumber,
"rnnumber/D");
182 edm::LogInfo(
"AnalyzerMB") <<
"Fired trigger bit number "<<itr->first.first;
192 mysubd = itr->first.second.subdet();
193 depth = itr->first.second.depth();
194 iphi = itr->first.second.iphi();
195 ieta = itr->first.second.ieta();
197 <<
" " <<
ieta <<
" " <<
iphi <<
" mom0 "
209 for(
unsigned int i = 0;
i<
histo.size();
i++){
228 edm::LogWarning(
"AnalyzerMB") <<
"HcalCalibAlgos: Error! can't get hbhe product!";
232 edm::LogInfo(
"AnalyzerMB") <<
"HBHE MB size of collection "<<HithbheMB.
size();
242 edm::LogWarning(
"AnalyzerMB") <<
"HcalCalibAlgos: Error! can't get hbhe product!";
246 edm::LogInfo(
"AnalyzerMB") <<
"HF MB size of collection " << HithfMB.
size();
258 if (gtObjectMapRecord.
isValid()) {
259 const std::vector<L1GlobalTriggerObjectMap>& objMapVec = gtObjectMapRecord->gtObjectMap();
261 for (std::vector<L1GlobalTriggerObjectMap>::const_iterator itMap = objMapVec.begin();
262 itMap != objMapVec.end(); ++itMap) {
263 bool resultGt = (*itMap).algoGtlResult();
265 int algoBit = (*itMap).algoBitNumber();
271 edm::LogInfo(
"AnalyzerMB") <<
"No passed L1 Trigger found";
282 hbheItr!=HithbheMB.
end(); hbheItr++) {
285 double icalconst(1.);
287 std::map<DetId,double>::iterator itr =
corrFactor_.find(mydetid);
288 if (itr !=
corrFactor_.end()) icalconst = itr->second;
290 HBHERecHit aHit(hbheItr->id(),hbheItr->energy()*icalconst,hbheItr->time());
291 double energyhit = aHit.
energy();
292 DetId id = (*hbheItr).detid();
296 for (
unsigned int i = 0;
i <
hcalID.size();
i++) {
298 histo[
i]->Fill(energyhit);
302 if (
runNZS_ || (energyhit >= eLow && energyhit <= eHigh)) {
303 std::map<std::pair<int,HcalDetId>,
myInfo>::iterator itr1 =
myMap.find(std::pair<int,HcalDetId>(algoBit,hid));
304 if (itr1 ==
myMap.end()) {
306 myMap[std::pair<int,HcalDetId>(algoBit,hid)] = info;
307 itr1 =
myMap.find(std::pair<int,HcalDetId>(algoBit,hid));
309 itr1->second.theMB0++;
310 itr1->second.theMB1 += energyhit;
311 itr1->second.theMB2 += (energyhit*energyhit);
312 itr1->second.theMB3 += (energyhit*energyhit*energyhit);
313 itr1->second.theMB4 += (energyhit*energyhit*energyhit*energyhit);
314 itr1->second.runcheck =
rnnum;
320 hfItr!=HithfMB.
end(); hfItr++) {
323 double icalconst(1.);
325 std::map<DetId,double>::iterator itr =
corrFactor_.find(mydetid);
326 if (itr !=
corrFactor_.end()) icalconst = itr->second;
328 HFRecHit aHit(hfItr->id(),hfItr->energy()*icalconst,hfItr->time());
330 double energyhit = aHit.
energy();
331 DetId id = (*hfItr).detid();
333 for (
unsigned int i = 0;
i <
hcalID.size();
i++) {
335 histo[
i]->Fill(energyhit);
342 if ((
runNZS_ && fabs(energyhit) <= 40.) ||
344 std::map<std::pair<int,HcalDetId>,
myInfo>::iterator itr1 =
myMap.find(std::pair<int,HcalDetId>(algoBit,hid));
345 if (itr1 ==
myMap.end()) {
347 myMap[std::pair<int,HcalDetId>(algoBit,hid)] = info;
348 itr1 =
myMap.find(std::pair<int,HcalDetId>(algoBit,hid));
350 itr1->second.theMB0++;
351 itr1->second.theMB1 += energyhit;
352 itr1->second.theMB2 += (energyhit*energyhit);
353 itr1->second.theMB3 += (energyhit*energyhit*energyhit);
354 itr1->second.theMB4 += (energyhit*energyhit*energyhit*energyhit);
355 itr1->second.runcheck =
rnnum;
std::vector< unsigned int > hcalID
T getParameter(std::string const &) const
RecAnalyzerMinbias(const edm::ParameterSet &)
T getUntrackedParameter(std::string const &, T const &) const
HcalSubdetector subdet() const
get the subdetector
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
std::vector< HBHERecHit >::const_iterator const_iterator
std::map< DetId, double > corrFactor_
virtual void analyze(const edm::Event &, const edm::EventSetup &)
uint32_t rawId() const
get the raw id
void analyzeHcal(const HBHERecHitCollection &, const HFRecHitCollection &, int)
std::map< std::pair< int, HcalDetId >, myInfo > myMap
edm::EDGetTokenT< HFRecHitCollection > tok_hfrecoMB_
Abs< T >::type abs(const T &t)
const_iterator end() const
T const * product() const
edm::EDGetTokenT< HBHERecHitCollection > tok_hbherecoMB_
std::string fOutputFileName
edm::EDGetTokenT< L1GlobalTriggerObjectMapRecord > tok_hltL1GtMap_
std::vector< TH1D * > histo
const_iterator begin() const