7 : m_name(ps.getUntrackedParameter<
std::
string>(
"name",
"EcalPulseSymmCovariancesHandler")) {
8 std::cout <<
"EcalPulseSymmCovariance Source handler constructor\n" << std::endl;
21 for (
int k = 0;
k <
N; ++
k) {
41 std::cout <<
"------- Ecal - > getNewObjects\n";
47 std::ifstream inputfile;
55 int nEBbad(0), nEEbad(0);
56 int nEBgood(0), nEEgood(0);
57 std::vector<EBDetId> ebgood;
58 std::vector<EEDetId> eegood;
62 while (std::getline(inputfile, line)) {
63 std::istringstream linereader(line);
64 linereader >> isbarrel >> rawId;
69 linereader >> covvals[
i][
j];
73 std::cout <<
"Wrong format of the text file. Exit." << std::endl;
81 k =
j + (EcalPulseShape::TEMPLATESAMPLES - 1) *
i;
83 k =
i + (EcalPulseShape::TEMPLATESAMPLES - 1) *
j;
93 ebgood.push_back(ebdetid);
102 eegood.push_back(eedetid);
110 std::cout <<
"Filled the DB with the good measured ECAL templates. Now filling the others with the TB values" 119 std::vector<EBDetId>::iterator it =
find(ebgood.begin(), ebgood.end(), ebdetid);
120 if (it == ebgood.end()) {
129 for (
int iZ = -1; iZ < 2; iZ += 2) {
135 std::vector<EEDetId>::iterator it =
find(eegood.begin(), eegood.end(), eedetid);
136 if (it == eegood.end()) {
146 std::cout <<
"Inserted the pulse covariances into the new item object" << std::endl;
153 std::cout <<
"Ecal - > end of getNewObjects -----------" << std::endl;
154 std::cout <<
"N. bad shapes for EB = " << nEBbad << std::endl;
155 std::cout <<
"N. bad shapes for EE = " << nEEbad << std::endl;
156 std::cout <<
"Written the object" << std::endl;
T getParameter(std::string const &) const
static const int MIN_IPHI
std::vector< double > m_EBPulseShapeCovariance
constexpr uint32_t rawId() const
get the raw id
static const int TEMPLATESAMPLES
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
OldContainer m_to_transfer
static bool validDetId(int i, int j)
check if a valid index combination
EcalPulseSymmCovariancesMap EcalPulseSymmCovariances
void getNewObjects() override
EcalPulseSymmCovariancesHandler(edm::ParameterSet const &)
static const int ETAPHIMODE
void insert(std::pair< uint32_t, Item > const &a)
static const int MAX_IPHI
void fillSimPulseSymmCovariance(EcalPulseSymmCovariances::Item *item, bool isbarrel)
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
static const int MAX_IETA
std::vector< double > m_EEPulseShapeCovariance
float covval[EcalPulseShape::TEMPLATESAMPLES *(EcalPulseShape::TEMPLATESAMPLES+1)/2]
bool checkPulseSymmCovariance(EcalPulseSymmCovariances::Item *item)
~EcalPulseSymmCovariancesHandler() override
Power< A, B >::type pow(const A &a, const B &b)