|
|
#include <StoreEcalCondition.h>
|
void | analyze (const edm::Event &evt, const edm::EventSetup &evtSetup) override |
|
int | convertFromConstructionSMToSlot (int, int) |
|
void | endJob () override |
|
EcalADCToGeVConstant * | readEcalADCToGeVConstantFromFile (const char *) |
|
EcalChannelStatus * | readEcalChannelStatusFromFile (const char *) |
|
EcalGainRatios * | readEcalGainRatiosFromFile (const char *) |
|
EcalIntercalibConstants * | readEcalIntercalibConstantsFromFile (const char *, const char *) |
|
EcalIntercalibConstantsMC * | readEcalIntercalibConstantsMCFromFile (const char *, const char *) |
|
EcalPFRecHitThresholds * | readEcalPFRecHitThresholdsFromFile (const char *, const char *) |
|
EcalTBWeights * | readEcalTBWeightsFromFile (const char *) |
|
EcalWeightXtalGroups * | readEcalWeightXtalGroupsFromFile (const char *) |
|
| StoreEcalCondition (const edm::ParameterSet &iConfig) |
|
void | writeToLogFile (std::string, std::string, unsigned long long) |
|
void | writeToLogFileResults (char *) |
|
| ~StoreEcalCondition () override |
|
void | callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func) |
|
| EDAnalyzer () |
|
SerialTaskQueue * | globalLuminosityBlocksQueue () |
|
SerialTaskQueue * | globalRunsQueue () |
|
ModuleDescription const & | moduleDescription () const |
|
std::string | workerType () const |
|
| ~EDAnalyzer () override |
|
std::vector< ConsumesInfo > | consumesInfo () const |
|
void | convertCurrentProcessAlias (std::string const &processName) |
| Convert "@currentProcess" in InputTag process names to the actual current process name. More...
|
|
| EDConsumerBase () |
|
| EDConsumerBase (EDConsumerBase &&)=default |
|
| EDConsumerBase (EDConsumerBase const &)=delete |
|
ESProxyIndex const * | esGetTokenIndices (edm::Transition iTrans) const |
|
ProductResolverIndexAndSkipBit | indexFrom (EDGetToken, BranchType, TypeID const &) const |
|
void | itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const |
|
void | itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const |
|
std::vector< ProductResolverIndexAndSkipBit > const & | itemsToGetFrom (BranchType iType) const |
|
void | labelsForToken (EDGetToken iToken, Labels &oLabels) const |
|
void | modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const |
|
EDConsumerBase & | operator= (EDConsumerBase &&)=default |
|
EDConsumerBase const & | operator= (EDConsumerBase const &)=delete |
|
bool | registeredToConsume (ProductResolverIndex, bool, BranchType) const |
|
bool | registeredToConsumeMany (TypeID const &, BranchType) const |
|
ProductResolverIndexAndSkipBit | uncheckedIndexFrom (EDGetToken) const |
|
void | updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet) |
|
void | updateLookup (eventsetup::ESRecordsToProxyIndices const &) |
|
virtual | ~EDConsumerBase () noexcept(false) |
|
|
typedef EDAnalyzer | ModuleType |
|
typedef ProductLabels | Labels |
|
static const std::string & | baseType () |
|
static void | fillDescriptions (ConfigurationDescriptions &descriptions) |
|
static void | prevalidate (ConfigurationDescriptions &) |
|
static bool | wantsGlobalLuminosityBlocks () |
|
static bool | wantsGlobalRuns () |
|
static bool | wantsStreamLuminosityBlocks () |
|
static bool | wantsStreamRuns () |
|
EDGetToken | consumes (const TypeToGet &id, edm::InputTag const &tag) |
|
template<typename ProductType , BranchType B = InEvent> |
EDGetTokenT< ProductType > | consumes (edm::InputTag const &tag) |
|
template<BranchType B> |
EDGetToken | consumes (TypeToGet const &id, edm::InputTag const &tag) |
|
ConsumesCollector | consumesCollector () |
| Use a ConsumesCollector to gather consumes information from helper functions. More...
|
|
template<typename ProductType , BranchType B = InEvent> |
void | consumesMany () |
|
void | consumesMany (const TypeToGet &id) |
|
template<BranchType B> |
void | consumesMany (const TypeToGet &id) |
|
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event> |
auto | esConsumes () |
|
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event> |
auto | esConsumes (ESInputTag const &tag) |
|
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
|
template<BranchType B> |
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
|
template<typename ProductType , BranchType B = InEvent> |
EDGetTokenT< ProductType > | mayConsume (edm::InputTag const &tag) |
|
Definition at line 39 of file StoreEcalCondition.h.
◆ StoreEcalCondition()
Definition at line 21 of file StoreEcalCondition.cc.
27 typedef std::vector<edm::ParameterSet>
Parameters;
29 for (Parameters::iterator itToPut =
toPut.begin(); itToPut !=
toPut.end(); ++itToPut) {
33 since_.push_back(itToPut->getUntrackedParameter<
unsigned int>(
"since"));
References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), inpFileName_, inpFileNameEE_, logfile_, objectName_, prog_name_, since_, sm_constr_, sm_slot_, AlCaHLTBitMon_QueryRunRegistry::string, and DBConfiguration_cff::toPut.
◆ ~StoreEcalCondition()
StoreEcalCondition::~StoreEcalCondition |
( |
| ) |
|
|
override |
◆ analyze()
◆ convertFromConstructionSMToSlot()
int StoreEcalCondition::convertFromConstructionSMToSlot |
( |
int |
sm_constr, |
|
|
int |
sm_slot |
|
) |
| |
Definition at line 907 of file StoreEcalCondition.cc.
912 int slot_to_constr[37] = {-1, 12, 17, 10, 1, 8, 4, 27, 20, 23, 25, 6, 34, 35, 15, 18, 30, 21, 9,
913 24, 22, 13, 31, 26, 16, 2, 11, 5, 0, 29, 28, 14, 33, 32, 3, 7, 19};
914 int constr_to_slot[36] = {28, 4, 25, 34, 6, 27, 11, 35, 5, 18, 3, 26, 1, 21, 31, 14, 24, 2,
915 15, 36, 8, 17, 20, 9, 19, 10, 23, 7, 30, 29, 16, 22, 33, 32, 12, 13};
918 if (sm_constr != -1) {
919 result = constr_to_slot[sm_constr];
920 }
else if (sm_slot != -1) {
921 result = slot_to_constr[sm_slot];
References mps_fire::result.
Referenced by readEcalIntercalibConstantsFromFile(), and readEcalIntercalibConstantsMCFromFile().
◆ endJob()
void StoreEcalCondition::endJob |
( |
void |
| ) |
|
|
overridevirtual |
Reimplemented from edm::EDAnalyzer.
Definition at line 39 of file StoreEcalCondition.cc.
42 edm::LogError(
"StoreEcalCondition") <<
"PoolDBOutputService is unavailable" << std::endl;
46 bool toAppend =
false;
49 size_t messageSize = message.size() + 1;
50 char* messChar =
new char[messageSize];
51 strncpy(messChar, message.c_str(), messageSize);
70 std::cout <<
"Reading " <<
objectName_[
i] <<
" from file and writing to DB with newTime " << newTime << endl;
76 mycali, newTime, mydbservice->
endOfTime(),
"EcalWeightXtalGroupsRcd");
91 mycali, newTime, mydbservice->
endOfTime(),
"EcalADCToGeVConstantRcd");
95 }
else if (
objectName_[
i] ==
"EcalIntercalibConstants") {
100 mycali, newTime, mydbservice->
endOfTime(),
"EcalIntercalibConstantsRcd");
104 }
else if (
objectName_[
i] ==
"EcalPFRecHitThresholds") {
109 mycali, newTime, mydbservice->
endOfTime(),
"EcalPFRecHitThresholdsRcd");
113 }
else if (
objectName_[
i] ==
"EcalIntercalibConstantsMC") {
118 mycali, newTime, mydbservice->
endOfTime(),
"EcalIntercalibConstantsMCRcd");
138 <<
"Object " <<
objectName_[
i] <<
" is not supported by this program." << endl;
145 edm::LogInfo(
"StoreEcalCondition") <<
"Finished endJob" << endl;
References cond::service::PoolDBOutputService::appendSinceTime(), cond::service::PoolDBOutputService::beginOfTime(), gather_cfg::cout, cond::service::PoolDBOutputService::createNewIOV(), cond::service::PoolDBOutputService::endOfTime(), mps_fire::i, inpFileName_, inpFileNameEE_, edm::Service< T >::isAvailable(), cond::service::PoolDBOutputService::isNewTagRequest(), objectName_, readEcalADCToGeVConstantFromFile(), readEcalChannelStatusFromFile(), readEcalGainRatiosFromFile(), readEcalIntercalibConstantsFromFile(), readEcalIntercalibConstantsMCFromFile(), readEcalPFRecHitThresholdsFromFile(), readEcalTBWeightsFromFile(), readEcalWeightXtalGroupsFromFile(), since_, AlCaHLTBitMon_QueryRunRegistry::string, and writeToLogFileResults().
◆ fillHeader()
void StoreEcalCondition::fillHeader |
( |
char * |
header | ) |
|
|
private |
◆ readEcalADCToGeVConstantFromFile()
EcalADCToGeVConstant * StoreEcalCondition::readEcalADCToGeVConstantFromFile |
( |
const char * |
inputFile | ) |
|
Definition at line 463 of file StoreEcalCondition.cc.
475 std::ostringstream
str;
477 fgets(
line, 255, inpFile);
478 int sm_number = atoi(
line);
479 str <<
"sm= " << sm_number << endl;
481 fgets(
line, 255, inpFile);
484 fgets(
line, 255, inpFile);
486 str <<
"gen tag " << gen_tag << endl;
488 fgets(
line, 255, inpFile);
490 str <<
"cali method " << cali_method << endl;
492 fgets(
line, 255, inpFile);
494 str <<
"cali version " << cali_version << endl;
496 fgets(
line, 255, inpFile);
498 str <<
"cali type " << cali_type << endl;
502 fgets(
line, 255, inpFile);
503 float adc_to_gev = 0;
504 sscanf(
line,
"%f", &adc_to_gev);
505 LogDebug(
"StoreEcalCondition") <<
" calib=" << adc_to_gev;
506 fgets(
line, 255, inpFile);
507 float adc_to_gev_ee = 0;
508 sscanf(
line,
"%f", &adc_to_gev_ee);
509 LogDebug(
"StoreEcalCondition") <<
" calib=" << adc_to_gev_ee;
517 edm::LogInfo(
"StoreEcalCondition") <<
"ADCtoGeV scale written into the DB";
References dtResolutionTest_cfi::inputFile, mps_splice::line, LogDebug, sm_constr_, str, and to_string().
Referenced by endJob().
◆ readEcalChannelStatusFromFile()
EcalChannelStatus * StoreEcalCondition::readEcalChannelStatusFromFile |
( |
const char * |
inputFile | ) |
|
Definition at line 1068 of file StoreEcalCondition.cc.
1077 status->setValue(ebid, 0);
1086 EEDetId eedetidpos(iX, iY, 1);
1087 status->setValue(eedetidpos, 0);
1090 EEDetId eedetidneg(iX, iY, -1);
1091 status->setValue(eedetidneg, 0);
1106 std::cout <<
"Gen tag " << gen_tag << std::endl;
1114 sscanf(
line,
"%d", &iovRunStart);
1115 std::cout <<
"IOV START " << iovRunStart << std::endl;
1120 sscanf(
line,
"%d", &iovRunEnd);
1121 std::cout <<
"IOV END " << iovRunEnd << std::endl;
1129 std::stringstream aStrStream;
1135 if (EBorEE ==
"EB") {
1137 status->setValue(aEBDetId, chStatus);
1138 }
else if (EBorEE ==
"EE") {
1141 status->setValue(aEEDetId, chStatus);
1142 }
else if (EBorEE ==
"EBTT") {
1146 int ixtt = (itt - 1) % 4;
1147 int iytt = (itt - 1) / 4;
1148 int ixmin = ixtt * 5;
1149 int iymin = iytt * 5;
1150 int ixmax = (ixtt + 1) * 5 - 1;
1151 int iymax = (iytt + 1) * 5 - 1;
1155 std::cout <<
"killing crystal " <<
ism <<
"/" << ixt << endl;
1157 status->setValue(ebid, 1);
References comment, gather_cfg::cout, Exception, ecalpyutils::hashedIndex(), LEDCalibrationChannels::ieta, compare_using_db::ifile, cuy::ii, dtResolutionTest_cfi::inputFile, LEDCalibrationChannels::iphi, ecalpyutils::ism(), EEDetId::IX_MAX, EEDetId::IX_MIN, EEDetId::IY_MAX, EEDetId::IY_MIN, mps_splice::line, EBDetId::MAX_IETA, EBDetId::MAX_IPHI, EBDetId::MIN_IPHI, EBDetId::SMCRYSTALMODE, mps_update::status, AlCaHLTBitMon_QueryRunRegistry::string, EBDetId::unhashIndex(), EEDetId::unhashIndex(), EBDetId::validDetId(), and EEDetId::validDetId().
Referenced by endJob().
◆ readEcalGainRatiosFromFile()
EcalGainRatios * StoreEcalCondition::readEcalGainRatiosFromFile |
( |
const char * |
inputFile | ) |
|
Definition at line 927 of file StoreEcalCondition.cc.
941 std::ostringstream
str;
943 fgets(
line, 255, inpFile);
946 sm_number = atoi(
line);
947 str <<
"sm= " << sm_number << endl;
949 fgets(
line, 255, inpFile);
952 fgets(
line, 255, inpFile);
954 str <<
"gen tag " << gen_tag << endl;
956 fgets(
line, 255, inpFile);
958 str <<
"cali method " << cali_method << endl;
960 fgets(
line, 255, inpFile);
962 str <<
"cali version " << cali_version << endl;
964 fgets(
line, 255, inpFile);
967 str <<
"cali type " << cali_type << endl;
971 int cry_num[61200] = {0};
972 float g1_g12[61200] = {0};
973 float g6_g12[61200] = {0};
974 int calib_status[61200] = {0};
981 if (sm_number != -1) {
982 while (fgets(
line, 255, inpFile)) {
983 sscanf(
line,
"%d %d %d %f %f %d", &dummy1, &dummy2, &cry_num[
ii], &g1_g12[
ii], &g6_g12[
ii], &calib_status[
ii]);
989 edm::LogInfo(
"StoreEcalCondition") <<
"Read gainRatios for " <<
ii <<
" xtals ";
991 edm::LogWarning(
"StoreEcalCondition") <<
" Missing crystals:: missing channels will be set to 0" << endl;
996 for (
int i = 0;
i < 1700;
i++) {
1004 gratio->
setValue(ebid.rawId(), gr);
1009 cout <<
"mode ALL BARREL" << endl;
1010 while (fgets(
line, 255, inpFile)) {
1013 sscanf(
line,
"%d %d %d %f %f", &hash1, &
eta, &
phi, &g1_g12[
ii], &g6_g12[
ii]);
1015 cout <<
"crystal eta/phi=" <<
eta <<
"/" <<
phi <<
" g1_12/g6_12= " << g1_g12[
ii] <<
"/" << g6_g12[
ii] << endl;
1017 if (g1_g12[
ii] < 9 || g1_g12[
ii] > 15)
1019 if (g6_g12[
ii] < 1 || g6_g12[
ii] > 3)
1022 if (eta < -85 || eta > 85 ||
eta == 0)
1024 if (phi < 1 || phi > 360)
1031 gratio->
setValue(ebid.rawId(), gr);
1038 edm::LogWarning(
"StoreEcalCondition") <<
" Missing crystals !!!!!!!" << endl;
1040 std::cout <<
"number of crystals read:" <<
ii << endl;
1051 EEDetId eedetidpos(iX, iY, 1);
1052 gratio->
setValue(eedetidpos.rawId(), gr);
1055 EEDetId eedetidneg(iX, iY, -1);
1056 gratio->
setValue(eedetidneg.rawId(), gr);
1061 std::cout <<
" gratio pointer=" << gratio << endl;
References gather_cfg::cout, PVValHelper::eta, EBDetId::ETAPHIMODE, mps_fire::i, cuy::ii, dtResolutionTest_cfi::inputFile, EEDetId::IX_MAX, EEDetId::IX_MIN, EEDetId::IY_MAX, EEDetId::IY_MIN, mps_splice::line, phi, DetId::rawId(), EcalMGPAGainRatio::setGain12Over6(), EcalMGPAGainRatio::setGain6Over1(), EcalCondObjectContainer< T >::setValue(), sm_constr_, sm_slot_, EBDetId::SMCRYSTALMODE, str, to_string(), and EEDetId::validDetId().
Referenced by endJob().
◆ readEcalIntercalibConstantsFromFile()
EcalIntercalibConstants * StoreEcalCondition::readEcalIntercalibConstantsFromFile |
( |
const char * |
inputFile, |
|
|
const char * |
inputFileEE |
|
) |
| |
Definition at line 591 of file StoreEcalCondition.cc.
606 std::ostringstream
str;
608 fgets(
line, 255, inpFile);
612 sm_number = atoi(
line);
613 str <<
"sm= " << sm_number << endl;
614 if (sm_number != -1) {
620 fgets(
line, 255, inpFile);
623 fgets(
line, 255, inpFile);
625 str <<
"gen tag " << gen_tag << endl;
627 fgets(
line, 255, inpFile);
629 str <<
"cali method " << cali_method << endl;
631 fgets(
line, 255, inpFile);
633 str <<
"cali version " << cali_version << endl;
635 fgets(
line, 255, inpFile);
637 str <<
"cali type " << cali_type << endl;
639 edm::LogInfo(
"StoreEcalCondition") <<
"Intercalibration file " <<
str.str();
641 int sm_num[61200] = {0};
642 int cry_num[61200] = {0};
643 float calib[61200] = {0};
644 float calib_rms[61200] = {0};
645 int calib_nevents[61200] = {0};
646 int calib_status[61200] = {0};
649 if (sm_number != -1) {
650 while (fgets(
line, 255, inpFile)) {
651 sscanf(
line,
"%d %f %f %d %d", &cry_num[
ii], &
calib[
ii], &calib_rms[
ii], &calib_nevents[
ii], &calib_status[
ii]);
655 sm_num[
ii] = sm_number;
660 cout <<
"mode ALL BARREL" << endl;
661 while (fgets(
line, 255, inpFile)) {
662 sscanf(
line,
"%d %d %f %f %d", &sm_num[
ii], &cry_num[
ii], &
calib[
ii], &calib_rms[
ii], &calib_status[
ii]);
664 cout <<
"crystal " << cry_num[
ii] <<
" of sm " << sm_num[
ii] <<
" cali= " <<
calib[
ii] << endl;
672 edm::LogInfo(
"StoreEcalCondition") <<
"Read intercalibrations for " <<
ii <<
" xtals ";
674 cout <<
" I read the calibrations for " <<
ii <<
" crystals " << endl;
676 edm::LogWarning(
"StoreEcalCondition") <<
"Some crystals missing. Missing channels will be set to 0" << endl;
693 cout <<
"crystal " << cry_num[
i] <<
" of sm " << sm_num[
i] <<
" in slot " << slot_num <<
" calib= " <<
calib[
i]
698 cout <<
"loop on channels done" << endl;
701 inpFileEE = fopen(inputFileEE,
"r");
715 EEDetId eedetidneg(iX, iY, -1);
722 cout <<
"... now reading EE file ..." << endl;
725 while (fgets(
line, 255, inpFileEE)) {
728 sscanf(
line,
"%d %d %d %f", &iz, &ix, &iy, &calibee);
730 cout <<
"crystal " << iz <<
"/" << ix <<
"/" << iy <<
" cali=" << calibee << endl;
743 cout <<
"loop on EE channels done" << endl;
References convertFromConstructionSMToSlot(), gather_cfg::cout, mps_fire::i, cuy::ii, dtResolutionTest_cfi::inputFile, EEDetId::IX_MAX, EEDetId::IX_MIN, EEDetId::IY_MAX, EEDetId::IY_MIN, mps_splice::line, nchan, DetId::rawId(), EcalCondObjectContainer< T >::setValue(), sm_constr_, EBDetId::SMCRYSTALMODE, str, to_string(), and EEDetId::validDetId().
Referenced by endJob().
◆ readEcalIntercalibConstantsMCFromFile()
EcalIntercalibConstantsMC * StoreEcalCondition::readEcalIntercalibConstantsMCFromFile |
( |
const char * |
inputFile, |
|
|
const char * |
inputFileEE |
|
) |
| |
Definition at line 749 of file StoreEcalCondition.cc.
764 std::ostringstream
str;
766 fgets(
line, 255, inpFile);
770 sm_number = atoi(
line);
771 str <<
"sm= " << sm_number << endl;
772 if (sm_number != -1) {
778 fgets(
line, 255, inpFile);
781 fgets(
line, 255, inpFile);
783 str <<
"gen tag " << gen_tag << endl;
785 fgets(
line, 255, inpFile);
787 str <<
"cali method " << cali_method << endl;
789 fgets(
line, 255, inpFile);
791 str <<
"cali version " << cali_version << endl;
793 fgets(
line, 255, inpFile);
795 str <<
"cali type " << cali_type << endl;
797 edm::LogInfo(
"StoreEcalCondition") <<
"Intercalibration file " <<
str.str();
799 int sm_num[61200] = {0};
800 int cry_num[61200] = {0};
801 float calib[61200] = {0};
802 float calib_rms[61200] = {0};
803 int calib_nevents[61200] = {0};
804 int calib_status[61200] = {0};
807 if (sm_number != -1) {
808 while (fgets(
line, 255, inpFile)) {
809 sscanf(
line,
"%d %f %f %d %d", &cry_num[
ii], &
calib[
ii], &calib_rms[
ii], &calib_nevents[
ii], &calib_status[
ii]);
813 sm_num[
ii] = sm_number;
818 cout <<
"mode ALL BARREL" << endl;
819 while (fgets(
line, 255, inpFile)) {
820 sscanf(
line,
"%d %d %f %f %d", &sm_num[
ii], &cry_num[
ii], &
calib[
ii], &calib_rms[
ii], &calib_status[
ii]);
822 cout <<
"crystal " << cry_num[
ii] <<
" of sm " << sm_num[
ii] <<
" cali= " <<
calib[
ii] << endl;
830 edm::LogInfo(
"StoreEcalCondition") <<
"Read intercalibrations for " <<
ii <<
" xtals ";
832 cout <<
" I read the calibrations for " <<
ii <<
" crystals " << endl;
834 edm::LogWarning(
"StoreEcalCondition") <<
"Some crystals missing. Missing channels will be set to 0" << endl;
851 cout <<
"crystal " << cry_num[
i] <<
" of sm " << sm_num[
i] <<
" in slot " << slot_num <<
" calib= " <<
calib[
i]
856 cout <<
"loop on channels done" << endl;
859 inpFileEE = fopen(inputFileEE,
"r");
873 EEDetId eedetidneg(iX, iY, -1);
880 cout <<
"... now reading EE file ..." << endl;
883 while (fgets(
line, 255, inpFileEE)) {
886 sscanf(
line,
"%d %d %d %f", &iz, &ix, &iy, &calibee);
888 cout <<
"crystal " << iz <<
"/" << ix <<
"/" << iy <<
" cali=" << calibee << endl;
901 cout <<
"loop on EE channels done" << endl;
References convertFromConstructionSMToSlot(), gather_cfg::cout, mps_fire::i, cuy::ii, dtResolutionTest_cfi::inputFile, EEDetId::IX_MAX, EEDetId::IX_MIN, EEDetId::IY_MAX, EEDetId::IY_MIN, mps_splice::line, nchan, DetId::rawId(), EcalCondObjectContainer< T >::setValue(), sm_constr_, EBDetId::SMCRYSTALMODE, str, to_string(), and EEDetId::validDetId().
Referenced by endJob().
◆ readEcalPFRecHitThresholdsFromFile()
EcalPFRecHitThresholds * StoreEcalCondition::readEcalPFRecHitThresholdsFromFile |
( |
const char * |
inputFile, |
|
|
const char * |
inputFileEE |
|
) |
| |
Definition at line 522 of file StoreEcalCondition.cc.
546 while (fgets(
line, 255, inpFile)) {
561 edm::LogInfo(
"StoreEcalCondition") <<
"Read PF RecHits for " <<
ii <<
" xtals ";
563 cout <<
" I read the thresholds for " <<
ii <<
" crystals " << endl;
566 inpFileEE = fopen(inputFileEE,
"r");
568 edm::LogError(
"StoreEcalCondition") <<
"*** Can not open file: " << inputFileEE;
572 while (fgets(
line, 255, inpFileEE)) {
573 sscanf(
line,
"%d %d %d %f ", &ix, &iy, &iz, &
thresh);
575 cout <<
"crystal " << ix <<
"/" << iy <<
"/" << iz <<
" Thresh= " <<
thresh << endl;
586 cout <<
"loop on EE channels done - number of crystals =" <<
ii << std::endl;
References gather_cfg::cout, LEDCalibrationChannels::ieta, cuy::ii, dtResolutionTest_cfi::inputFile, LEDCalibrationChannels::iphi, mps_splice::line, DetId::rawId(), EcalCondObjectContainer< T >::setValue(), GOODCOLL_filter_cfg::thresh, EBDetId::validDetId(), and EEDetId::validDetId().
Referenced by endJob().
◆ readEcalTBWeightsFromFile()
EcalTBWeights * StoreEcalCondition::readEcalTBWeightsFromFile |
( |
const char * |
inputFile | ) |
|
Definition at line 315 of file StoreEcalCondition.cc.
323 if (!WeightsFileTB.is_open()) {
328 int smnumber = -99999;
330 std::ostringstream
str;
331 WeightsFileTB >> smnumber;
332 if (smnumber == -99999)
335 str <<
"sm= " << smnumber << endl;
339 for (
int i = 0;
i <= 5;
i++) {
340 WeightsFileTB.getline(
temp, 255);
347 while (WeightsFileTB.good()) {
348 int igroup_ID = -99999;
350 int nTdcBins = -99999;
352 WeightsFileTB >> igroup_ID >>
nSamples >> nTdcBins;
353 if (igroup_ID == -99999 ||
nSamples == -99999 || nTdcBins == -99999)
356 std::ostringstream
str;
357 str <<
"Igroup=" << igroup_ID <<
" Nsamples=" <<
nSamples <<
" NTdcBins=" << nTdcBins <<
"\n";
359 for (
int iTdcBin = 0; iTdcBin < nTdcBins; iTdcBin++) {
451 tbwgt->
setValue(std::make_pair(igroup_ID, iTdcBin + 1), wgt);
458 edm::LogInfo(
"StoreEcalCondition") <<
"Weights for " << ngroups <<
" groups written into DB";
References EcalWeightSet::getChi2WeightsAfterGainSwitch(), EcalWeightSet::getChi2WeightsBeforeGainSwitch(), EcalWeightSet::getWeightsAfterGainSwitch(), EcalWeightSet::getWeightsBeforeGainSwitch(), mps_fire::i, dtResolutionTest_cfi::inputFile, dqmiolumiharvest::j, dqmdumpme::k, LogDebug, PresampleTask_cfi::nSamples, EcalTBWeights::setValue(), sm_constr_, str, and groupFilesInBlocks::temp.
Referenced by endJob().
◆ readEcalWeightXtalGroupsFromFile()
EcalWeightXtalGroups * StoreEcalCondition::readEcalWeightXtalGroupsFromFile |
( |
const char * |
inputFile | ) |
|
Definition at line 249 of file StoreEcalCondition.cc.
257 if (!groupid_in.is_open()) {
262 int smnumber = -99999;
264 std::ostringstream
str;
265 groupid_in >> smnumber;
266 if (smnumber == -99999) {
267 edm::LogError(
"StoreEcalCondition") <<
"ERROR: SM number not found in file" << endl;
270 str <<
"sm= " << smnumber << endl;
275 for (
int i = 0;
i <= 5;
i++) {
276 groupid_in.getline(
temp, 255);
281 groupid_in.getline(
temp, 255);
287 int xtal, ietaf, iphif, groupID;
288 while (groupid_in.good()) {
289 groupid_in >> xtal >> ietaf >> iphif >> groupID;
290 if (groupid_in.eof()) {
294 LogDebug(
"StoreEcalCondition") <<
"XTAL=" << xtal <<
" ETA=" << ietaf <<
" PHI=" << iphif <<
" GROUP=" << groupID;
304 edm::LogError(
"StoreEcalCondition") <<
"ERROR: GROUPID file did not contain data for 1700 crystals" << endl;
308 edm::LogInfo(
"StoreEcalCondition") <<
"Groups for " << xtals <<
" xtals written into DB";
References mps_fire::i, dtResolutionTest_cfi::inputFile, LogDebug, DetId::rawId(), EcalCondObjectContainer< T >::setValue(), sm_constr_, sm_slot_, EBDetId::SMCRYSTALMODE, str, and groupFilesInBlocks::temp.
Referenced by endJob().
◆ to_string()
std::string StoreEcalCondition::to_string |
( |
char |
value[] | ) |
|
|
inlineprivate |
◆ writeToLogFile()
void StoreEcalCondition::writeToLogFile |
( |
std::string |
, |
|
|
std::string |
, |
|
|
unsigned long long |
|
|
) |
| |
Definition at line 159 of file StoreEcalCondition.cc.
172 sprintf(appendMode,
"append");
174 sprintf(appendMode,
"create");
177 "%s %s condition from file %s written into DB for SM %d (mapped to SM %d) in %s mode (since run %u)\n",
References a, b, fillHeader(), RecoTauValidation_cfi::header, createfilelist::int, logfile_, L1TdeCSCTF_cfi::outFile, writeEcalDQMStatus::since, sm_constr_, and sm_slot_.
◆ writeToLogFileResults()
void StoreEcalCondition::writeToLogFileResults |
( |
char * |
arg | ) |
|
◆ inpFileName_
std::vector<std::string> StoreEcalCondition::inpFileName_ |
|
private |
◆ inpFileNameEE_
std::vector<std::string> StoreEcalCondition::inpFileNameEE_ |
|
private |
◆ logfile_
std::string StoreEcalCondition::logfile_ |
|
private |
◆ objectName_
std::vector<std::string> StoreEcalCondition::objectName_ |
|
private |
◆ prog_name_
std::string StoreEcalCondition::prog_name_ |
|
private |
◆ since_
std::vector<unsigned long long> StoreEcalCondition::since_ |
|
private |
◆ sm_constr_
int StoreEcalCondition::sm_constr_ |
|
private |
◆ sm_slot_
int StoreEcalCondition::sm_slot_ |
|
private |
int convertFromConstructionSMToSlot(int, int)
void setGain6Over1(const float &g)
cond::Time_t beginOfTime() const
static EEDetId unhashIndex(int hi)
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
std::string to_string(char value[])
void appendSinceTime(const T *payloadObj, cond::Time_t sinceTime, const std::string &recordName)
EcalIntercalibConstantsMC * readEcalIntercalibConstantsMCFromFile(const char *, const char *)
EcalPFRecHitThresholdsMap EcalPFRecHitThresholds
T getUntrackedParameter(std::string const &, T const &) const
EcalGainRatios * readEcalGainRatiosFromFile(const char *)
EcalGainRatioMap EcalGainRatios
math::Matrix< 3, 10 >::type EcalWeightMatrix
std::vector< std::string > inpFileName_
EcalTBWeights * readEcalTBWeightsFromFile(const char *)
void setValue(const EcalXtalGroupId &groupId, const EcalTDCId &tdcId, const EcalWeightSet &weight)
void createNewIOV(const T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t, const std::string &recordName)
EcalPFRecHitThresholds * readEcalPFRecHitThresholdsFromFile(const char *, const char *)
std::vector< std::string > inpFileNameEE_
static const int MAX_IPHI
EcalIntercalibConstantMap EcalIntercalibConstants
EcalWeightMatrix & getWeightsAfterGainSwitch()
void setGain12Over6(const float &g)
static const int ETAPHIMODE
EcalWeightMatrix & getWeightsBeforeGainSwitch()
void setValue(const uint32_t id, const Item &item)
EcalCondObjectContainer< EcalXtalGroupId > EcalWeightXtalGroups
math::Matrix< 10, 10 >::type EcalChi2WeightMatrix
unsigned long long Time_t
std::vector< unsigned long long > since_
EcalChi2WeightMatrix & getChi2WeightsAfterGainSwitch()
EcalADCToGeVConstant * readEcalADCToGeVConstantFromFile(const char *)
EcalChannelStatusMap EcalChannelStatus
cond::Time_t endOfTime() const
static bool validDetId(int i, int j)
check if a valid index combination
EcalChannelStatus * readEcalChannelStatusFromFile(const char *)
T getParameter(std::string const &) const
int ism(int ieta, int iphi)
EcalIntercalibConstants * readEcalIntercalibConstantsFromFile(const char *, const char *)
bool isNewTagRequest(const std::string &recordName)
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
EcalChi2WeightMatrix & getChi2WeightsBeforeGainSwitch()
vector< ParameterSet > Parameters
EcalWeightXtalGroups * readEcalWeightXtalGroupsFromFile(const char *)
static const int SMCRYSTALMODE
int hashedIndex(int ieta, int iphi)
void writeToLogFileResults(char *)
EcalIntercalibConstantMCMap EcalIntercalibConstantsMC
std::vector< std::string > objectName_
static const int MAX_IETA
static const int MIN_IPHI