35 std::cout <<
"------- Ecal - > getNewObjects\n";
41 std::ifstream inputfile;
49 int nEBbad(0), nEEbad(0);
50 std::vector<EBDetId> ebgood;
51 std::vector<EEDetId> eegood;
55 while (std::getline(inputfile,
line)) {
56 std::istringstream linereader(
line);
57 linereader >> isbarrel >>
rawId;
60 linereader >> templatevals[
s];
66 std::cout <<
"Wrong format of the text file. Exit." << std::endl;
71 item.pdfval[
s] = templatevals[
s];
78 ebgood.push_back(ebdetid);
79 pulseshapes->
insert(std::make_pair(ebdetid.rawId(),
item));
86 eegood.push_back(eedetid);
87 pulseshapes->
insert(std::make_pair(eedetid.rawId(),
item));
94 std::cout <<
"Filled the DB with the good measured ECAL templates. Now filling the others with the TB values" 103 std::vector<EBDetId>::iterator it =
find(ebgood.begin(), ebgood.end(), ebdetid);
104 if (it == ebgood.end()) {
107 pulseshapes->
insert(std::make_pair(ebdetid.rawId(),
item));
113 for (
int iZ = -1; iZ < 2; iZ += 2) {
119 std::vector<EEDetId>::iterator it =
find(eegood.begin(), eegood.end(), eedetid);
120 if (it == eegood.end()) {
123 pulseshapes->
insert(std::make_pair(eedetid.rawId(),
item));
130 std::cout <<
"Inserted the pulse shapes into the new item object" << std::endl;
137 std::cout <<
"Ecal - > end of getNewObjects -----------" << std::endl;
138 std::cout <<
"N. bad shapes for EB = " << nEBbad << std::endl;
139 std::cout <<
"N. bad shapes for EE = " << nEEbad << std::endl;
140 std::cout <<
"Written the object" << std::endl;
EcalPulseShapesMap EcalPulseShapes
static const int MIN_IPHI
static const int TEMPLATESAMPLES
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
static bool validDetId(int i, int j)
check if a valid index combination
bool checkPulseShape(EcalPulseShapes::Item *item)
void fillSimPulseShape(EcalPulseShapes::Item *item, bool isbarrel)
std::vector< std::pair< EcalPulseShapes *, Time_t > > m_to_transfer
static const int ETAPHIMODE
void insert(std::pair< uint32_t, Item > const &a)
static const int MAX_IPHI
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
static const int MAX_IETA