49 : g4Label_(ps.getParameter<
std::
string>(
"moduleLabel")),
50 caloHitSource_(ps.getParameter<
std::
string>(
"caloHitSource")),
51 nameSense_(ps.getParameter<
std::
string>(
"nameSense")),
52 tileFileName_(ps.getParameter<
std::
string>(
"tileFileName")),
60 std::ifstream fInput(
fileName.c_str());
65 while (fInput.getline(
buffer, 80)) {
67 if (
items.size() > 2) {
70 int phi = std::atoi(
items[2].c_str());
86 descriptions.
add(
"hgcalHitScintillator",
desc);
93 int firstLayer =
hgc.firstLayer() - 1;
96 bool getHits = (hitsCalo.
isValid());
97 uint32_t
nhits = (getHits) ? hitsCalo->size() : 0;
99 edm::LogVerbatim(
"HGCalSim") <<
"HGCalTestScintHits: Input flags Hits " << getHits <<
" with " <<
nhits 100 <<
" hits first Layer " << firstLayer;
103 std::vector<PCaloHit>
hits;
104 hits.insert(
hits.end(), hitsCalo->begin(), hitsCalo->end());
111 std::pair<int, int> typm =
hgc.tileType(hid.layer(), hid.ring(), 0);
112 if (typm.first >= 0) {
113 hid.setType(typm.first);
114 hid.setSiPM(typm.second);
115 id =
static_cast<DetId>(hid);
126 bool valid1 =
geom->topology().valid(
id);
127 bool valid2 =
hgc.isValidTrap(hid.zside(), hid.layer(), hid.ring(), hid.iphi());
129 <<
pos.y() <<
", " <<
pos.z() <<
") Validity " << valid1 <<
":" << valid2
130 <<
" Energy " <<
hit.energy() <<
" Time " <<
hit.time();
Log< level::Info, true > LogVerbatim
std::vector< int > tiles_
auto const good
min quality of good
std::vector< PCaloHit > PCaloHitContainer
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
void analyze(edm::Event const &, edm::EventSetup const &) override
const std::string tileFileName_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const edm::EDGetTokenT< edm::PCaloHitContainer > tok_calo_
int32_t tileIndex(int32_t layer, int32_t ring, int32_t phi)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const std::string caloHitSource_
std::vector< std::string > splitString(const std::string &)
HGCalTestScintHits(const edm::ParameterSet &ps)
const edm::ESGetToken< HGCalGeometry, IdealGeometryRecord > geomToken_
#define DEFINE_FWK_MODULE(type)
~HGCalTestScintHits() override=default
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const std::string nameSense_
const std::string g4Label_