91 << theRecalib <<
" (IgnoreL1): " << ignoreL1 <<
" with "
92 << ieta.size() <<
" detId for full histogram" << std::endl;
94 for (
unsigned int k=0;
k<ieta.size(); ++
k) {
99 unsigned int id = (
HcalDetId(subd,ieta[k],iphi[k],depth[k])).rawId();
111 for (
unsigned int i=0;
i<
hcalID.size();
i++) {
113 int subdet =
id.subdetId();
114 sprintf (
name,
"%s%d_%d_%d", hc[subdet].c_str(),
id.
ieta(),
id.
iphi(),
id.
depth());
115 sprintf (
title,
"Energy Distribution for %s ieta %d iphi %d depth %d", hc[subdet].c_str(),
id.
ieta(),
id.
iphi(),
id.
depth());
116 double xmin = (subdet == 4) ? -10 : -1;
117 double xmax = (subdet == 4) ? 90 : 9;
118 TH1D* hh =
new TH1D(
name,
title, 50, xmin, xmax);
123 myTree =
new TTree(
"RecJet",
"RecJet Tree");
124 myTree->Branch(
"cells", &
cells,
"cells/I");
125 myTree->Branch(
"mysubd", &
mysubd,
"mysubd/I");
126 myTree->Branch(
"depth", &
depth,
"depth/I");
127 myTree->Branch(
"ieta", &
ieta,
"ieta/I");
128 myTree->Branch(
"iphi", &
iphi,
"iphi/I");
129 myTree->Branch(
"mom0_MB", &
mom0_MB,
"mom0_MB/F");
130 myTree->Branch(
"mom1_MB", &
mom1_MB,
"mom1_MB/F");
131 myTree->Branch(
"mom2_MB", &
mom2_MB,
"mom2_MB/F");
132 myTree->Branch(
"mom3_MB", &
mom2_MB,
"mom3_MB/F");
133 myTree->Branch(
"mom4_MB", &
mom4_MB,
"mom4_MB/F");
134 myTree->Branch(
"trigbit", &
trigbit,
"trigbit/I");
135 myTree->Branch(
"rnnumber", &
rnnumber,
"rnnumber/D");
147 std::cout <<
"Fired trigger bit number " << itr->first.first << std::endl;
158 mysubd = itr->first.second.subdet();
159 depth = itr->first.second.depth();
160 iphi = itr->first.second.iphi();
161 ieta = itr->first.second.ieta();
179 for(
unsigned int i = 0;
i<
histo.size();
i++){
198 myRecalib = recalibCorrs.
product();
204 edm::LogInfo(
"AnalyzerMB") <<
"HcalCalibAlgos: Error! can't get hbhe product!";
209 std::cout <<
"HBHE MB size of collection " << HithbheMB.
size() << std::endl;
211 if (HithbheMB.
size() < 5100) {
220 edm::LogInfo(
"AnalyzerMB") <<
"HcalCalibAlgos: Error! can't get hbhe product!";
225 std::cout <<
"HF MB size of collection " << HithfMB.
size() << std::endl;
227 if (HithfMB.
size() < 1700) {
238 if (gtObjectMapRecord.
isValid()) {
239 const std::vector<L1GlobalTriggerObjectMap>& objMapVec = gtObjectMapRecord->gtObjectMap();
241 for (std::vector<L1GlobalTriggerObjectMap>::const_iterator itMap = objMapVec.begin();
242 itMap != objMapVec.end(); ++itMap) {
243 bool resultGt = (*itMap).algoGtlResult();
245 int algoBit = (*itMap).algoBitNumber();
246 analyzeHcal(HithbheMB, HithfMB, myRecalib, algoBit);
252 std::cout <<
"No passed L1 Trigger found" << std::endl;
265 hbheItr!=HithbheMB.
end(); hbheItr++) {
270 HBHERecHit aHit(hbheItr->id(),hbheItr->energy()*icalconst,hbheItr->time());
271 double energyhit = aHit.
energy();
272 DetId id = (*hbheItr).detid();
275 for (
unsigned int i = 0;
i <
hcalID.size();
i++) {
277 histo[
i]->Fill(energyhit);
281 std::map<std::pair<int,HcalDetId>,
myInfo>::iterator itr1 =
myMap.find(std::pair<int,HcalDetId>(algoBit,hid));
282 if (itr1 ==
myMap.end()) {
284 myMap[std::pair<int,HcalDetId>(algoBit,hid)] = info;
285 itr1 =
myMap.find(std::pair<int,HcalDetId>(algoBit,hid));
287 itr1->second.theMB0++;
288 itr1->second.theMB1 += energyhit;
289 itr1->second.theMB2 += (energyhit*energyhit);
290 itr1->second.theMB3 += (energyhit*energyhit*energyhit);
291 itr1->second.theMB4 += (energyhit*energyhit*energyhit*energyhit);
292 itr1->second.runcheck =
rnnum;
297 hfItr!=HithfMB.
end(); hfItr++) {
302 HFRecHit aHit(hfItr->id(),hfItr->energy()*icalconst,hfItr->time());
304 double energyhit = aHit.
energy();
305 DetId id = (*hfItr).detid();
307 for (
unsigned int i = 0;
i <
hcalID.size();
i++) {
309 histo[
i]->Fill(energyhit);
316 if (fabs(energyhit) > 40.)
continue;
317 std::map<std::pair<int,HcalDetId>,
myInfo>::iterator itr1 =
myMap.find(std::pair<int,HcalDetId>(algoBit,hid));
318 if (itr1 ==
myMap.end()) {
320 myMap[std::pair<int,HcalDetId>(algoBit,hid)] = info;
321 itr1 =
myMap.find(std::pair<int,HcalDetId>(algoBit,hid));
323 itr1->second.theMB0++;
324 itr1->second.theMB1 += energyhit;
325 itr1->second.theMB2 += (energyhit*energyhit);
326 itr1->second.theMB3 += (energyhit*energyhit*energyhit);
327 itr1->second.theMB4 += (energyhit*energyhit*energyhit*energyhit);
328 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
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
std::vector< HBHERecHit >::const_iterator const_iterator
virtual void analyze(const edm::Event &, const edm::EventSetup &)
const Item * getValues(DetId fId, bool throwOnFail=true) const
uint32_t rawId() const
get the raw id
std::map< std::pair< int, HcalDetId >, myInfo > myMap
edm::EDGetTokenT< HFRecHitCollection > tok_hfrecoMB_
void analyzeHcal(const HBHERecHitCollection &, const HFRecHitCollection &, const HcalRespCorrs *, int)
Abs< T >::type abs(const T &t)
const_iterator end() const
T const * product() 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