64 std::vector<std::pair<TH1D*,TH1D*>>
histo_;
70 kount = f11 = f12 = f13 = f14 = f21 = f22 = f23 = f24 = runcheck = 0;
86 usesResource(
"TFileService");
105 <<
" (NZS) " <<
nzs_ <<
" (Noise) " << noise_
109 for (
unsigned int k=0;
k<ieta.size(); ++
k) {
117 <<
" L1 Trigger selection";
119 for (
auto trig : trigbit_) {
129 desc.
add<
bool>(
"RunNZS",
true);
130 desc.
add<
bool>(
"Noise",
false);
131 desc.
add<
bool>(
"Ratio",
false);
132 desc.
add<
double>(
"ELowHF",10);
133 desc.
add<
double>(
"EHighHF",150);
134 std::vector<int> idummy;
135 desc.
addUntracked<std::vector<int> >(
"TriggerBits",idummy);
138 desc.
addUntracked<std::vector<int> >(
"HcalIeta",idummy);
139 desc.
addUntracked<std::vector<int> >(
"HcalIphi",idummy);
140 desc.
addUntracked<std::vector<int> >(
"HcalDepth",idummy);
142 descriptions.
add(
"recAnalyzerHF",desc);
150 for (
int i=0;
i<2; ++
i) {
151 sprintf(name,
"HF%d",
i);
152 sprintf (title,
"The metric F%d for HF",
i+1);
156 for (
const auto &
id :
hcalID_) {
158 TH1D *h1(
nullptr), *h2(
nullptr);
159 for (
int i=0;
i<2; ++
i) {
160 sprintf (name,
"HF%d%d_%d_%d",
i, hid.
ieta(), hid.
iphi(), hid.
depth());
161 sprintf (title,
"The metric F%d for HF i#eta %d i#phi %d depth %d",
166 histo_.push_back(std::pair<TH1D*,TH1D*>(h1,h2));
197 for (
const auto & itr :
myMap_) {
201 if (info.
kount > 0) {
214 mysubd = itr.first.second.subdet();
215 depth = itr.first.second.depth();
216 iphi = itr.first.second.iphi();
217 ieta = itr.first.second.ieta();
220 <<
" F1:mom0 " <<
mom0_F1 <<
" mom1 " 222 <<
" mom3 " <<
mom3_F1 <<
" mom4 " 224 <<
" mom1 " <<
mom1_F2 <<
" mom2 " 250 edm::LogWarning(
"RecAnalyzer") <<
"HcalCalibAlgos: Error! can't get hf product!";
265 if (gtObjectMapRecord.
isValid()) {
266 const std::vector<L1GlobalTriggerObjectMap>& objMapVec = gtObjectMapRecord->
gtObjectMap();
267 for (std::vector<L1GlobalTriggerObjectMap>::const_iterator itMap = objMapVec.begin();
268 itMap != objMapVec.end(); ++itMap) {
269 bool resultGt = (*itMap).algoGtlResult();
271 int algoBit = (*itMap).algoBitNumber();
289 if (gtObjectMapRecord.
isValid()) {
290 const std::vector<L1GlobalTriggerObjectMap>& objMapVec = gtObjectMapRecord->
gtObjectMap();
292 for (std::vector<L1GlobalTriggerObjectMap>::const_iterator itMap = objMapVec.begin();
293 itMap != objMapVec.end(); ++itMap) {
294 bool resultGt = (*itMap).algoGtlResult();
296 int algoBit = (*itMap).algoBitNumber();
309 int algoBit,
bool fill) {
312 <<
" Fill " << fill <<
" Collection size " 316 for (
const auto & hfItr : Hithf) {
318 double e0 = (hfItr.getHFQIE10Info(0)==
nullptr) ? 0 : hfItr.getHFQIE10Info(0)->energy();
319 double e1 = (hfItr.getHFQIE10Info(1)==
nullptr) ? 0 : hfItr.getHFQIE10Info(1)->energy();
320 double energy = e0+e1;
321 if (
std::abs(energy) < 1
e-6) energy = (energy > 0) ? 1
e-6 : -1
e-6;
322 double f1(e0),
f2(e1);
329 <<
" F " <<
f1 <<
":" <<
f2;
332 for (
unsigned int i = 0;
i <
hcalID_.size();
i++) {
346 if (((
noise_ ||
nzs_) && fabs(energy) <= 40.) ||
348 std::map<std::pair<int,HcalDetId>,
myInfo>::iterator itr1 =
myMap_.find(std::pair<int,HcalDetId>(algoBit,hid));
349 if (itr1 ==
myMap_.end()) {
351 myMap_[std::pair<int,HcalDetId>(algoBit,hid)] = info;
352 itr1 =
myMap_.find(std::pair<int,HcalDetId>(algoBit,hid));
354 itr1->second.kount += 1.0;
355 itr1->second.f11 += (
f1);
356 itr1->second.f12 += (
f1*
f1);
357 itr1->second.f13 += (
f1*
f1*
f1);
359 itr1->second.f21 += (
f2);
360 itr1->second.f22 += (f2*
f2);
361 itr1->second.f23 += (f2*f2*
f2);
362 itr1->second.f24 += (f2*f2*f2*
f2);
363 itr1->second.runcheck =
rnnum_;
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
std::vector< unsigned int > hcalID_
constexpr uint32_t rawId() const
get the raw id
std::vector< int > trigbit_
T * make(const Args &...args) const
make new ROOT object
void analyze(edm::Event const &, edm::EventSetup const &) override
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
~RecAnalyzerHF() override
const std::vector< L1GlobalTriggerObjectMap > & gtObjectMap() const
get / set the vector of object maps
int depth() const
get the tower depth
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< std::pair< TH1D *, TH1D * > > histo_
RecAnalyzerHF(const edm::ParameterSet &)
int ieta() const
get the cell ieta
Abs< T >::type abs(const T &t)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::EDGetTokenT< HFPreRecHitCollection > tok_hfreco_
int iphi() const
get the cell iphi
edm::Service< TFileService > fs_
T const * product() const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::EDGetTokenT< L1GlobalTriggerObjectMapRecord > tok_hltL1GtMap_
void analyzeHcal(const HFPreRecHitCollection &, int, bool)
std::map< std::pair< int, HcalDetId >, myInfo > myMap_