69 : timeCut_(iConfig.getUntrackedParameter<double>(
"TimeCut", 500)),
78 desc.addUntracked<
double>(
"TimeCut", 500);
79 descriptions.
add(
"simAnalyzerMinbias",
desc);
84 myTree_ =
fs->make<TTree>(
"SimJet",
"SimJet Tree");
104 for (std::map<HcalDetId, myInfo>::const_iterator itr =
myMap_.begin(); itr !=
myMap_.end(); ++itr) {
105 mysubd = itr->first.subdet();
106 depth = itr->first.depth();
107 iphi = itr->first.iphi();
108 ieta = itr->first.ieta();
110 if (
info.theMB0 > 0) {
134 edm::LogVerbatim(
"SimAnalyzerMinbias") <<
" Start SimAnalyzerMinbias::analyze " <<
iEvent.id().run() <<
":" 142 edm::LogVerbatim(
"SimAnalyzerMinbias") <<
"Event with " << myGenEvent->particles_size() <<
" particles + " 143 << myGenEvent->vertices_size() <<
" vertices";
148 edm::LogWarning(
"SimAnalyzerMinbias") <<
"Error! can't get HcalHits product!";
153 std::map<HcalDetId, double> hitMap;
154 for (std::vector<PCaloHit>::const_iterator hcalItr = HitHcal->begin(); hcalItr != HitHcal->end(); ++hcalItr) {
155 double time = hcalItr->time();
157 double energyhit = hcalItr->energy();
159 std::map<HcalDetId, double>::iterator itr1 = hitMap.find(hid);
160 if (itr1 == hitMap.end()) {
162 itr1 = hitMap.find(hid);
164 itr1->second += energyhit;
167 edm::LogVerbatim(
"SimAnalyzerMinbias") <<
"extract information of " << hitMap.size() <<
" towers from " 168 << HitHcal->size() <<
" hits";
170 for (std::map<HcalDetId, double>::const_iterator hcalItr = hitMap.begin(); hcalItr != hitMap.end(); ++hcalItr) {
172 double energyhit = hcalItr->second;
173 std::map<HcalDetId, myInfo>::iterator itr1 =
myMap_.find(hid);
174 if (itr1 ==
myMap_.end()) {
179 itr1->second.theMB0++;
180 itr1->second.theMB1 += energyhit;
181 itr1->second.theMB2 += (energyhit * energyhit);
182 itr1->second.theMB3 += (energyhit * energyhit * energyhit);
183 itr1->second.theMB4 += (energyhit * energyhit * energyhit * energyhit);
184 edm::LogVerbatim(
"SimAnalyzerMinbias") <<
"ID " << hid <<
" with energy " << energyhit;
static const std::string kSharedResource
Log< level::Info, true > LogVerbatim
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< PCaloHit > PCaloHitContainer
#define DEFINE_FWK_MODULE(type)
T const * product() const
void endRun(const edm::Run &r, const edm::EventSetup &iSetup) override
void beginRun(const edm::Run &r, const edm::EventSetup &iSetup) override
const edm::EDGetTokenT< edm::HepMCProduct > tok_evt_
const HepMC::GenEvent * GetEvent() const
void analyze(const edm::Event &, const edm::EventSetup &) override
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const edm::EDGetTokenT< edm::PCaloHitContainer > tok_hcal_
std::map< HcalDetId, myInfo > myMap_
SimAnalyzerMinbias(const edm::ParameterSet &)
Log< level::Warning, false > LogWarning