62 std::vector<std::pair<TH1D*, TH1D*>>
histo_;
81 usesResource(
"TFileService");
99 edm::LogVerbatim(
"RecAnalyzer") <<
" Flags (IgnoreL1): " << ignoreL1_ <<
" (NZS) " <<
nzs_ <<
" (Noise) " << noise_
102 for (
unsigned int k = 0;
k < ieta.size(); ++
k) {
109 edm::LogVerbatim(
"RecAnalyzer") <<
"Select on " << trigbit_.size() <<
" L1 Trigger selection";
111 for (
auto trig : trigbit_) {
122 desc.
add<
bool>(
"RunNZS",
true);
123 desc.
add<
bool>(
"Noise",
false);
124 desc.
add<
bool>(
"Ratio",
false);
125 desc.
add<
double>(
"ELowHF", 10);
126 desc.
add<
double>(
"EHighHF", 150);
127 std::vector<int> idummy;
128 desc.
addUntracked<std::vector<int>>(
"TriggerBits", idummy);
131 desc.
addUntracked<std::vector<int>>(
"HcalIeta", idummy);
132 desc.
addUntracked<std::vector<int>>(
"HcalIphi", idummy);
133 desc.
addUntracked<std::vector<int>>(
"HcalDepth", idummy);
135 descriptions.
add(
"recAnalyzerHF", desc);
145 for (
int i = 0;
i < 2; ++
i) {
146 sprintf(name,
"HF%d",
i);
147 sprintf(title,
"The metric F%d for HF",
i + 1);
151 for (
const auto&
id :
hcalID_) {
153 TH1D *h1(
nullptr), *h2(
nullptr);
154 for (
int i = 0;
i < 2; ++
i) {
155 sprintf(name,
"HF%d%d_%d_%d",
i, hid.
ieta(), hid.
iphi(), hid.
depth());
156 sprintf(title,
"The metric F%d for HF i#eta %d i#phi %d depth %d",
i + 1, hid.
ieta(), hid.
iphi(), hid.
depth());
162 histo_.push_back(std::pair<TH1D*, TH1D*>(h1, h2));
192 for (
const auto& itr :
myMap_) {
193 edm::LogVerbatim(
"RecAnalyzer") <<
"Fired trigger bit number " << itr.first.first;
195 if (info.
kount > 0) {
208 mysubd = itr.first.second.subdet();
209 depth = itr.first.second.depth();
210 iphi = itr.first.second.iphi();
211 ieta = itr.first.second.ieta();
240 edm::LogWarning(
"RecAnalyzer") <<
"HcalCalibAlgos: Error! can't get hf product!";
253 if (gtObjectMapRecord.
isValid()) {
254 const std::vector<L1GlobalTriggerObjectMap>& objMapVec = gtObjectMapRecord->gtObjectMap();
255 for (std::vector<L1GlobalTriggerObjectMap>::const_iterator itMap = objMapVec.begin(); itMap != objMapVec.end();
257 bool resultGt = (*itMap).algoGtlResult();
259 int algoBit = (*itMap).algoBitNumber();
276 if (gtObjectMapRecord.
isValid()) {
277 const std::vector<L1GlobalTriggerObjectMap>& objMapVec = gtObjectMapRecord->gtObjectMap();
279 for (std::vector<L1GlobalTriggerObjectMap>::const_iterator itMap = objMapVec.begin(); itMap != objMapVec.end();
281 bool resultGt = (*itMap).algoGtlResult();
283 int algoBit = (*itMap).algoBitNumber();
297 edm::LogVerbatim(
"RecAnalyzer") <<
"Enter analyzeHcal for bit " << algoBit <<
" Fill " << fill <<
" Collection size "
301 for (
const auto& hfItr : Hithf) {
303 double e0 = (hfItr.getHFQIE10Info(0) ==
nullptr) ? 0 : hfItr.getHFQIE10Info(0)->energy();
304 double e1 = (hfItr.getHFQIE10Info(1) ==
nullptr) ? 0 : hfItr.getHFQIE10Info(1)->energy();
307 energy = (energy > 0) ? 1
e-6 : -1
e-6;
308 double f1(e0),
f2(e1);
317 for (
unsigned int i = 0;
i <
hcalID_.size();
i++) {
332 std::map<std::pair<int, HcalDetId>,
myInfo>::iterator itr1 =
myMap_.find(std::pair<int, HcalDetId>(algoBit, hid));
333 if (itr1 ==
myMap_.end()) {
335 myMap_[std::pair<int, HcalDetId>(algoBit, hid)] = info;
336 itr1 =
myMap_.find(std::pair<int, HcalDetId>(algoBit, hid));
338 itr1->second.kount += 1.0;
339 itr1->second.f11 += (
f1);
340 itr1->second.f12 += (
f1 *
f1);
341 itr1->second.f13 += (
f1 *
f1 *
f1);
342 itr1->second.f14 += (
f1 *
f1 *
f1 *
f1);
343 itr1->second.f21 += (
f2);
344 itr1->second.f22 += (f2 *
f2);
345 itr1->second.f23 += (f2 * f2 *
f2);
346 itr1->second.f24 += (f2 * f2 * f2 *
f2);
347 itr1->second.runcheck =
rnnum_;
Log< level::Info, true > LogVerbatim
T getUntrackedParameter(std::string const &, T const &) const
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
std::map< std::pair< int, HcalDetId >, myInfo > myMap_
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
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
constexpr int iphi() const
get the cell iphi
std::vector< std::pair< TH1D *, TH1D * > > histo_
RecAnalyzerHF(const edm::ParameterSet &)
Abs< T >::type abs(const T &t)
constexpr int ieta() const
get the cell ieta
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::EDGetTokenT< HFPreRecHitCollection > tok_hfreco_
edm::Service< TFileService > fs_
void fill(std::map< std::string, TH1 * > &h, const std::string &s, double x)
T const * product() const
T getParameter(std::string const &) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::EDGetTokenT< L1GlobalTriggerObjectMapRecord > tok_hltL1GtMap_
constexpr int depth() const
get the tower depth
Log< level::Warning, false > LogWarning
void analyzeHcal(const HFPreRecHitCollection &, int, bool)