51 if (Et<1
e-6)
return 1./par[1] ;
52 double resolEt_overEt =
sqrt( (par[0]/
sqrt(Et))*(par[0]/
sqrt(Et)) + (par[1]/Et)*(par[1]/Et) + par[2]*par[2] ) ;
53 return 1./(Et*resolEt_overEt) ;
57 : xtal_LSB_EB_(0), xtal_LSB_EE_(0), nSample_(5), complement2_(7), useDBShape_(
true)
113 if (
writeToDB_)
edm::LogInfo(
"TopInfo") <<
"data will be saved with tag and version=" << tag_ <<
".version" << version_<<
"\n";
168 useTransparencyCorr_ = pSet.
getParameter<
bool>(
"useTransparencyCorr") ;
174 if(SFGVB_SpikeKillingThreshold_ == -1 || (SFGVB_SpikeKillingThreshold_ > Et_sat_EB_))
175 SFGVB_SpikeKillingThreshold_ = 1023;
177 SFGVB_SpikeKillingThreshold_ =
int(SFGVB_SpikeKillingThreshold_ * 1024/Et_sat_EB_);
178 edm::LogInfo(
"TopInfo") <<
"INFO:SPIKE KILLING THRESHOLD (ADC)=" << SFGVB_SpikeKillingThreshold_ <<
"\n";
187 std::ostringstream ss;
189 ss <<
"INFO: READING timing files\n";
192 std::ifstream delay_ee(TimingDelays_EE_.c_str());
193 if(!delay_ee)
edm::LogError(
"TopInfo") <<
"ERROR: File " << TimingDelays_EE_.c_str() <<
" could not be opened" <<
"\n";
194 std::ifstream phase_eb(TimingPhases_EB_.c_str());
195 if(!phase_eb)
edm::LogError(
"TopInfo") <<
"ERROR: File " << TimingPhases_EB_.c_str() <<
" could not be opened" <<
"\n";
196 std::ifstream phase_ee(TimingPhases_EE_.c_str());
197 if(!phase_ee)
edm::LogError(
"TopInfo") <<
"ERROR: File " << TimingPhases_EE_.c_str() <<
" could not be opened" <<
"\n";
201 delay_eb.getline(buf,
sizeof(buf),
'\n');
203 std::stringstream
sin(buf);
208 vector<int> vec_delays_eb;
209 for(
int ieb=0; ieb<68; ++ieb){
212 vec_delays_eb.push_back(time_delay);
213 if(time_delay==-1)
edm::LogError(
"TopInfo") <<
"ERROR:Barrel timing delay -1, check file" <<
"\n";
216 if(vec_delays_eb.size()!=68)
217 edm::LogError(
"TopInfo") <<
"ERROR:Barrel timing delay wrong, not enough towers, check file" <<
"\n";
220 delays_EB_.insert(make_pair(tcc,vec_delays_eb));
224 for(
unsigned int ieb=0; ieb<vec_delays_eb.size(); ++ieb)
226 ss <<
" " << vec_delays_eb[ieb];
227 delay_eb.getline(buf,
sizeof(buf),
'\n');
233 phase_eb.getline(buf,
sizeof(buf),
'\n');
235 std::stringstream
sin(buf);
239 vector<int> vec_phases_eb;
240 for(
unsigned int ieb=0; ieb<68; ++ieb){
243 vec_phases_eb.push_back(time_phase);
244 if(time_phase==-1)
edm::LogError(
"TopInfo") <<
"ERROR:Barrel timing phase -1, check file" <<
"\n";
247 if(vec_phases_eb.size()!=68)
248 edm::LogError(
"TopInfo") <<
"ERROR:Barrel timing phase wrong, not enough towers, check file" <<
"\n";
251 phases_EB_.insert(make_pair(tcc,vec_phases_eb));
255 for(
unsigned int ieb=0; ieb<vec_phases_eb.size(); ++ieb)
257 ss <<
" " << vec_phases_eb[ieb];
258 phase_eb.getline(buf,
sizeof(buf),
'\n');
264 delay_ee.getline(buf,
sizeof(buf),
'\n');
266 std::stringstream
sin(buf);
270 vector<int> vec_delays_ee;
271 for(
unsigned int iee=0; iee<48; ++iee){
274 vec_delays_ee.push_back(time_delay);
275 if(time_delay==-1)
edm::LogError(
"TopInfo") <<
"ERROR:EE timing delay -1, check file" <<
"\n";
278 if(vec_delays_ee.size()!=48)
279 edm::LogError(
"TopInfo") <<
"ERROR:EE timing delay wrong, not enough towers, check file" <<
"\n";
282 delays_EE_.insert(make_pair(tcc,vec_delays_ee));
286 for(
unsigned int iee=0; iee<vec_delays_ee.size(); ++iee)
288 ss <<
" " << vec_delays_ee[iee];
290 delay_ee.getline(buf,
sizeof(buf),
'\n');
295 phase_ee.getline(buf,
sizeof(buf),
'\n');
297 std::stringstream
sin(buf);
301 vector<int> vec_phases_ee;
302 for(
unsigned int iee=0; iee<48; ++iee){
305 vec_phases_ee.push_back(time_phase);
306 if(time_phase==-1)
edm::LogError(
"TopInfo") <<
"ERROR:EE timing phase -1, check file" <<
"\n";
309 if(vec_phases_ee.size()!=48)
310 edm::LogError(
"TopInfo") <<
"ERROR:EE timing phase wrong, not enough towers, check file" <<
"\n";
313 phases_EE_.insert(make_pair(tcc,vec_phases_ee));
316 for(
unsigned int iee = 0; iee < vec_phases_ee.size(); ++iee)
318 ss <<
" " << vec_phases_ee[iee];
320 phase_ee.getline(buf,
sizeof(buf),
'\n');
325 ss <<
"INFO: DONE reading timing files for EB and EE\n";
330 if(useTransparencyCorr_){
332 ss <<
"INFO: READING transparency correction files\n";
333 std::ifstream transparency(Transparency_Corr_.c_str());
334 if(!transparency)
edm::LogError(
"TopInfo") <<
"ERROR: File " << Transparency_Corr_.c_str() <<
" could not be opened" <<
"\n";
336 transparency.getline(buf,
sizeof(buf),
'\n');
338 while( transparency ) {
339 std::stringstream
sin(buf);
344 double xtal_trans_corr;
345 sin >> xtal_trans_corr;
348 ss << raw_xtal_id <<
" " << xtal_trans_corr <<
"\n";
353 transparency.getline(buf,
sizeof(buf),
'\n');
355 transparency.close();
356 ss <<
"INFO: DONE transparency correction files " << xtalcounter <<
"\n";
365 (*out_file_ )<<
"EOF"<<std::endl ;
386 int etaSlice = (towerInTCC-1)/4+1 ;
388 if (tccId>36 || tccId<73)
return etaSlice ;
391 if (tccId >=1 && tccId <= 18) etaSlice += 21 ;
392 if (tccId >=19 && tccId <= 36) etaSlice += 17 ;
393 if (tccId >=91 && tccId <= 108) etaSlice += 21 ;
394 if (tccId >=73 && tccId <= 90) etaSlice += 17 ;
420 std::ostringstream ss;
421 ss <<
"EcalLaserDbAnalyzer::analyze\n";
424 ss <<
"EcalLaserDbAnalyzer::analyze-> got EcalLaserDbRecord: \n";
432 for(italpha = laserAlphaMap.
barrelItems().begin(); italpha != laserAlphaMap.
barrelItems().end(); ++italpha) {
433 if (cnt %1000 == 0) {
435 ss <<
" Barrel ALPHA = " << (*italpha) <<
" cmsswId " << ebdetid.
rawId() <<
"\n";
439 ss <<
"Number of barrel Alpha parameters : " << cnt <<
"\n";
442 for(italpha = laserAlphaMap.
endcapItems().begin(); italpha != laserAlphaMap.
endcapItems().end(); ++italpha) {
443 if (cnt %1000 == 0) {
445 ss <<
"EndCap ALPHA = " << (*italpha) <<
" cmsswId " << eedetid.
rawId() <<
"\n";
449 ss <<
"Number of Endcap Alpha parameters : " << cnt <<
"\n";
455 TFile saving (
"EcalTPGParam.root",
"recreate") ;
457 TH2F * ICEB =
new TH2F(
"ICEB",
"IC: Barrel", 360, 1, 361, 172, -86, 86) ;
458 ICEB->GetYaxis()->SetTitle(
"eta index") ;
459 ICEB->GetXaxis()->SetTitle(
"phi index") ;
460 TH2F * tpgFactorEB =
new TH2F(
"tpgFactorEB",
"tpgFactor: Barrel", 360, 1, 361, 172, -86, 86) ;
461 tpgFactorEB->GetYaxis()->SetTitle(
"eta index") ;
462 tpgFactorEB->GetXaxis()->SetTitle(
"phi index") ;
464 TH2F * ICEEPlus =
new TH2F(
"ICEEPlus",
"IC: Plus Endcap", 120, -9, 111, 120, -9, 111) ;
465 ICEEPlus->GetYaxis()->SetTitle(
"y index") ;
466 ICEEPlus->GetXaxis()->SetTitle(
"x index") ;
467 TH2F * tpgFactorEEPlus =
new TH2F(
"tpgFactorEEPlus",
"tpgFactor: Plus Endcap", 120, -9, 111, 120, -9, 111) ;
468 tpgFactorEEPlus->GetYaxis()->SetTitle(
"y index") ;
469 tpgFactorEEPlus->GetXaxis()->SetTitle(
"x index") ;
470 TH2F * ICEEMinus =
new TH2F(
"ICEEMinus",
"IC: Minus Endcap", 120, -9, 111, 120, -9, 111) ;
471 ICEEMinus->GetYaxis()->SetTitle(
"y index") ;
472 ICEEMinus->GetXaxis()->SetTitle(
"x index") ;
473 TH2F * tpgFactorEEMinus =
new TH2F(
"tpgFactorEEMinus",
"tpgFactor: Minus Endcap", 120, -9, 111, 120, -9, 111) ;
474 tpgFactorEEMinus->GetYaxis()->SetTitle(
"y index") ;
475 tpgFactorEEMinus->GetXaxis()->SetTitle(
"x index") ;
477 TH2F * IC =
new TH2F(
"IC",
"IC", 720, -acos(-1.), acos(-1.), 600, -3., 3.) ;
478 IC->GetYaxis()->SetTitle(
"eta") ;
479 IC->GetXaxis()->SetTitle(
"phi") ;
480 TH2F * tpgFactor =
new TH2F(
"tpgFactor",
"tpgFactor", 720, -acos(-1.), acos(-1.), 600, -3., 3.) ;
481 tpgFactor->GetYaxis()->SetTitle(
"eta") ;
482 tpgFactor->GetXaxis()->SetTitle(
"phi") ;
484 TH1F * hshapeEB =
new TH1F(
"shapeEB",
"shapeEB", 250, 0., 10.) ;
485 TH1F * hshapeEE =
new TH1F(
"shapeEE",
"shapeEE", 250, 0., 10.) ;
487 TTree *
ntuple =
new TTree(
"tpgmap",
"TPG geometry map") ;
488 const std::string branchFloat[26] = {
"fed",
"tcc",
"tower",
"stripInTower",
"xtalInStrip",
489 "CCU",
"VFE",
"xtalInVFE",
"xtalInCCU",
"ieta",
"iphi",
490 "ix",
"iy",
"iz",
"hashedId",
"ic",
"cmsswId",
"dbId",
"ietaTT",
"iphiTT",
491 "TCCch",
"TCCslot",
"SLBch",
"SLBslot",
"ietaGCT",
"iphiGCT"} ;
493 for (
int i=0 ;
i<26 ;
i++) ntuple->Branch(branchFloat[
i].c_str(),&
ntupleInts_[
i],(branchFloat[
i]+
string(
"/I")).c_str()) ;
498 TNtuple *ntupleSpike =
new TNtuple(
"spikeParam",
"Spike parameters",
"gainId:theta:G:g:ped:pedLin") ;
506 list<uint32_t> towerListEB ;
507 list<uint32_t> stripListEB ;
508 list<uint32_t> towerListEE ;
509 list<uint32_t> stripListEE ;
510 list<uint32_t>::iterator itList ;
512 map<int, uint32_t> stripMapEB ;
513 map<uint32_t, uint32_t> stripMapEBsintheta ;
521 ss <<
"Getting the pedestals from offline DB...\n";
530 for (pedIter = pedMap.
begin() ; pedIter != pedMap.
end() && nPed<10 ; ++pedIter, nPed++) {
535 ss <<
"Getting the pedestals from previous configuration\n";
541 ss <<
"trying to read previous tag if it exists tag="<<
tag_<<
".version"<<
version_<<
"\n";
542 db_-> fetchConfigSet(&fe_main_info);
547 db_-> fetchConfigSet(&fe_ped_info);
548 std::map<EcalLogicID, FEConfigPedDat> dataset_TpgPed;
551 typedef std::map<EcalLogicID, FEConfigPedDat>::const_iterator CIfeped;
555 for (CIfeped
p = dataset_TpgPed.begin();
p != dataset_TpgPed.end();
p++)
563 if (ecid_name==
"EB_crystal_number") {
566 int sm_num=ecid_xt.
getID1();
567 int xt_num=ecid_xt.
getID2();
578 if(icells<10) ss <<
" copy the EB data " <<
" ped = " << item.
mean_x12<<
"\n";
583 }
else if (ecid_name==
"EE_crystal_number"){
607 for (pedIter = pedMap.
begin() ; pedIter != pedMap.
end() && nPed<10 ; ++pedIter, nPed++) {
617 ss <<
"Getting the pedestals from configuration number"<<
m_write_ped <<
"\n";
626 fe_ped_info.
setId(m_write_ped);
627 db_-> fetchConfigSet(&fe_ped_info);
628 std::map<EcalLogicID, FEConfigPedDat> dataset_TpgPed;
631 typedef std::map<EcalLogicID, FEConfigPedDat>::const_iterator CIfeped;
635 for (CIfeped
p = dataset_TpgPed.begin();
p != dataset_TpgPed.end();
p++)
643 if (ecid_name==
"EB_crystal_number") {
644 if(icells<10)
edm::LogInfo(
"TopInfo") <<
" copy the EB data " <<
" icells = " << icells <<
"\n";
645 int sm_num=ecid_xt.
getID1();
646 int xt_num=ecid_xt.
getID2();
659 }
else if (ecid_name==
"EE_crystal_number"){
683 for (pedIter = pedMap.
begin() ; pedIter != pedMap.
end() && nPed<10 ; ++pedIter, nPed++) {
693 ss <<
"Getting intercalib from offline DB...\n";
700 for (calIter = calibMap.
begin() ; calIter != calibMap.
end() && nCal<10 ; ++calIter, nCal++) {
701 ss << (*calIter)<<
"\n" ;
705 float calibvec[1700] ;
707 edm::LogInfo(
"TopInfo") <<
"H2: overwriting IC coef with file"<<
"\n" ;
712 if (calibfile.is_open()) {
713 calibfile >> strdata >> strdata >> strdata >> strdata >> strdata ;
714 while(!calibfile.eof()) {
715 calibfile >> idata >> icry >> fcali >> fdata >> fdata ;
716 calibvec[icry-1] = fcali ;
725 ss <<
"Getting the gain ratios from offline DB...\n";
731 for (gainIter = gainMap.
begin() ; gainIter != gainMap.
end() && nGain<10 ; ++gainIter, nGain++) {
739 ss <<
"Getting the ADC to GeV from offline DB...\n";
748 vector<EcalLogicID> my_EcalLogicId;
749 vector<EcalLogicID> my_TTEcalLogicId;
750 vector<EcalLogicID> my_StripEcalLogicId;
754 vector<EcalLogicID> my_TTEcalLogicId_EE;
755 vector<EcalLogicID> my_RTEcalLogicId_EE;
756 vector<EcalLogicID> my_StripEcalLogicId1_EE;
757 vector<EcalLogicID> my_StripEcalLogicId2_EE;
758 vector<EcalLogicID> my_CrystalEcalLogicId_EE;
759 vector<EcalLogicID> my_TTEcalLogicId_EB_by_TCC;
760 vector<EcalLogicID> my_StripEcalLogicId_EE_strips_by_TCC;
768 "EB_crystal_number",12 );
773 "EB_trigger_tower",12 );
775 ss <<
"got the 3 ecal barrel logic id set\n";
782 "EE_crystal_number",123 );
790 "ECAL_readout_strip",123 );
797 "ECAL_readout_strip",123 );
805 "EE_trigger_strip",123 );
815 "ECAL_trigger_tower",12 );
823 "EE_trigger_tower",12 );
831 "EE_readout_tower",12 );
836 ss <<
"Getting the latest ids for this tag (latest version) "<<
"\n";
841 ss <<
"trying to read previous tag if it exists tag="<<
tag_<<
".version"<<
version_<<
"\n";
843 db_-> fetchConfigSet(&fe_main_info);
864 map<EcalLogicID, FEConfigPedDat> pedset ;
865 map<EcalLogicID, FEConfigLinDat> linset ;
866 map<EcalLogicID, FEConfigLinParamDat> linparamset ;
867 map<EcalLogicID, FEConfigLUTParamDat> lutparamset ;
868 map<EcalLogicID, FEConfigFgrParamDat> fgrparamset ;
870 map<int, linStruc> linEtaSlice ;
871 map< vector<int>,
linStruc > linMap ;
874 int NbOfStripPerTCC[108][68] ;
875 for (
int i=0 ;
i<108 ;
i++)
876 for (
int j=0 ; j<68 ; j++)
877 NbOfStripPerTCC[
i][j] = 0 ;
880 for (vector<DetId>::const_iterator it = ebCells.begin(); it != ebCells.end(); ++it) {
887 if (stripInTower>NbOfStripPerTCC[tccNb-1][towerInTCC-1]) NbOfStripPerTCC[tccNb-1][towerInTCC-1] = stripInTower ;
889 for (vector<DetId>::const_iterator it = eeCells.begin(); it != eeCells.end(); ++it) {
896 if (stripInTower>NbOfStripPerTCC[tccNb-1][towerInTCC-1]) NbOfStripPerTCC[tccNb-1][towerInTCC-1] = stripInTower ;
902 if (
writeToFiles_) (*out_file_)<<
"COMMENT ====== barrel crystals ====== "<<std::endl ;
905 for (vector<DetId>::const_iterator it = ebCells.begin(); it != ebCells.end(); ++it) {
919 int xtalInVFE = Id.
xtalId() ;
920 int xtalWithinCCUid = 5*(VFEid-1) + xtalInVFE -1 ;
922 (*geomFile_)<<
"dccNb = "<<dccNb<<
" tccNb = "<<tccNb<<
" towerInTCC = "<<towerInTCC
923 <<
" stripInTower = "<<stripInTower<<
" xtalInStrip = "<<xtalInStrip
924 <<
" CCUid = "<<CCUid<<
" VFEid = "<<VFEid<<
" xtalInVFE = "<<xtalInVFE
925 <<
" xtalWithinCCUid = "<<xtalWithinCCUid<<
" ieta = "<<
id.ieta()<<
" iphi = "<<
id.iphi()
926 <<
" xtalhashedId = "<<
id.hashedIndex()<<
" xtalNb = "<<
id.ic()
927 <<
" ietaTT = "<<towid.
ieta()<<
" iphiTT = "<<towid.
iphi()<<endl ;
929 int TCCch = towerInTCC ;
930 int SLBslot =
int((towerInTCC-1)/8.) + 1 ;
931 int SLBch = (towerInTCC-1)%8 + 1 ;
932 int cmsswId =
id.rawId() ;
933 int ixtal=(
id.ism()-1)*1700+(
id.ic()-1);
936 int val[] = {dccNb+600,tccNb,towerInTCC,stripInTower,
937 xtalInStrip,CCUid,VFEid,xtalInVFE,xtalWithinCCUid,
id.ieta(),
id.iphi(),
939 id.ic(), cmsswId, dbId,
949 if (tccNb == 37 && stripInTower == 3 && xtalInStrip == 3 && (towerInTCC-1)%4==0) {
950 int etaSlice = towid.
ietaAbs() ;
955 getCoeff(coeff, calibMap, laserAlphaMap,
id.rawId(), str) ;
957 getCoeff(coeff, gainMap,
id.rawId()) ;
958 getCoeff(coeff, pedMap,
id.rawId()) ;
960 for (
int i=0 ;
i<3 ;
i++) {
963 if (!ok)
edm::LogError(
"TopInfo") <<
"unable to compute the parameters for SM="<<
id.ism()<<
" xt="<<
id.ic()<<
" " <<
dec<<
id.rawId()<<
"\n" ;
973 if (!ok) ss <<
"SM="<<
id.ism()<<
" xt="<<
id.ic()<<
" " <<
dec<<
id.rawId()<<
"\n" ;
974 linEtaSlice[etaSlice] = lin ;
979 for (vector<DetId>::const_iterator it = ebCells.begin(); it != ebCells.end(); ++it) {
984 towerListEB.push_back(towid.
rawId()) ;
986 stripListEB.push_back(elId.
rawId() & 0xfffffff8) ;
995 int xtalInVFE = Id.
xtalId() ;
996 int xtalWithinCCUid = 5*(VFEid-1) + xtalInVFE -1 ;
997 int etaSlice = towid.
ietaAbs() ;
1000 int hashedStripLogicID = 68*5*(
id.ism()-1) + 5*(towerInTCC-1) + (VFEid-1) ;
1001 stripMapEB[hashedStripLogicID] = elId.
rawId() & 0xfffffff8 ;
1025 getCoeff(coeff, calibMap, laserAlphaMap,
id.rawId(), str) ;
1029 getCoeff(coeff, gainMap,
id.rawId()) ;
1030 getCoeff(coeff, pedMap,
id.rawId()) ;
1031 ICEB->Fill(
id.iphi(),
id.ieta(), coeff.
calibCoeff_) ;
1034 vector<int> xtalCCU ;
1035 xtalCCU.push_back(dccNb+600) ;
1036 xtalCCU.push_back(CCUid) ;
1037 xtalCCU.push_back(xtalWithinCCUid) ;
1038 xtalCCU.push_back(
id.rawId()) ;
1043 map<int, linStruc>::const_iterator itLin = linEtaSlice.find(etaSlice);
1044 if (itLin != linEtaSlice.end()) {
1045 linMap[xtalCCU] = itLin->second ;
1047 for (
int i=0 ;
i<3 ;
i++)
1048 (*
out_file_) << hex <<
" 0x"<<itLin->second.pedestal_[
i]<<
" 0x"<<itLin->second.mult_[
i]<<
" 0x"<<itLin->second.shift_[
i]<<std::endl;
1051 for (
int i=0 ;
i<3 ;
i++) {
1058 tpgFactorEB->Fill(
id.iphi(),
id.ieta(), factor) ;
1062 else ss <<
"current EtaSlice = "<<etaSlice<<
" not found in the EtaSlice map"<<
"\n" ;
1067 int forceBase12 = 0 ;
1068 for (
int i=0 ;
i<3 ;
i++) {
1071 if (!ok)
edm::LogError(
"TopInfo") <<
"unable to compute the parameters for SM="<<
id.ism()<<
" xt="<<
id.ic()<<
" " <<
dec<<
id.rawId()<<
"\n" ;
1083 double G = mult*
pow(2.0,-(shift+2)) ;
1084 double g = G/
sin(theta) ;
1086 base = double(coeff.
pedestals_[
i]) - pedestal_offset_/
g ;
1087 if (base<0.) base = 0 ;
1088 forceBase12 =
int(base) ;
1107 if (!ok) ss <<
"SM="<<
id.ism()<<
" xt="<<
id.ic()<<
" " <<
dec<<
id.rawId()<<
"\n" ;
1109 for (
int i=0 ;
i<3 ;
i++) {
1118 tpgFactorEB->Fill(
id.iphi(),
id.ieta(), factor) ;
1123 double g = G/
sin(theta) ;
1130 ntupleSpike->Fill(val) ;
1132 linMap[xtalCCU] = lin ;
1136 int ixtal=(
id.ism()-1)*1700+(
id.ic()-1);
1138 pedset[logicId] = pedDB ;
1139 linset[logicId] = linDB ;
1147 linparamset[my_EcalLogicId_EB] = linparam ;
1154 fgrparamset[my_EcalLogicId_EB] = fgrparam ;
1161 lutparamset[my_EcalLogicId_EB] = lutparam ;
1167 if (
writeToFiles_) (*out_file_)<<
"COMMENT ====== endcap crystals ====== "<<std::endl ;
1170 for (vector<DetId>::const_iterator it = eeCells.begin(); it != eeCells.end(); ++it) {
1177 int dccNb = Id.
dccId() ;
1184 int xtalInVFE = Id.
xtalId() ;
1185 int xtalWithinCCUid = 5*(VFEid-1) + xtalInVFE -1 ;
1187 (*geomFile_)<<
"dccNb = "<<dccNb<<
" tccNb = "<<tccNb<<
" towerInTCC = "<<towerInTCC
1188 <<
" stripInTower = "<<stripInTower<<
" xtalInStrip = "<<xtalInStrip
1189 <<
" CCUid = "<<CCUid<<
" VFEid = "<<VFEid<<
" xtalInVFE = "<<xtalInVFE
1190 <<
" xtalWithinCCUid = "<<xtalWithinCCUid<<
" ix = "<<
id.ix()<<
" iy = "<<
id.iy()
1191 <<
" xtalhashedId = "<<
id.hashedIndex()<<
" xtalNb = "<<
id.isc()
1192 <<
" ietaTT = "<<towid.
ieta()<<
" iphiTT = "<<towid.
iphi()<<endl ;
1194 int TCCch = stripInTower ;
1195 int SLBslot, SLBch ;
1198 SLBch = 4 + towerInTCC ;
1201 SLBslot =
int((towerInTCC-5)/8.) + 2 ;
1202 SLBch = (towerInTCC-5)%8 + 1 ;
1204 for (
int j=0 ; j<towerInTCC-1 ; j++) TCCch += NbOfStripPerTCC[tccNb-1][j] ;
1206 int cmsswId =
id.rawId() ;
1208 int iz =
id.positiveZ() ;
1209 if (iz ==0) iz = -1 ;
1210 for (
int k=0;
k<(
int)my_CrystalEcalLogicId_EE.size();
k++) {
1211 int z= my_CrystalEcalLogicId_EE[
k].getID1() ;
1212 int x= my_CrystalEcalLogicId_EE[
k].getID2() ;
1213 int y= my_CrystalEcalLogicId_EE[
k].getID3() ;
1214 if (
id.ix()==x &&
id.iy()==y && iz==z) logicId=my_CrystalEcalLogicId_EE[
k];
1218 int val[] = {dccNb+600,tccNb,towerInTCC,stripInTower,
1219 xtalInStrip,CCUid,VFEid,xtalInVFE,xtalWithinCCUid,-999,-999,
1221 id.ic(),cmsswId, dbId,
1229 if ((tccNb == 76 || tccNb == 94) && stripInTower == 1 && xtalInStrip == 3 && (towerInTCC-1)%4==0) {
1230 int etaSlice = towid.
ietaAbs() ;
1235 getCoeff(coeff, calibMap, laserAlphaMap,
id.rawId(), str) ;
1237 getCoeff(coeff, gainMap,
id.rawId()) ;
1238 getCoeff(coeff, pedMap,
id.rawId()) ;
1240 for (
int i=0 ;
i<3 ;
i++) {
1243 if (!ok)
edm::LogError(
"TopInfo") <<
"unable to compute the parameters for Quadrant="<<
id.iquadrant()<<
" xt="<<
id.ic()<<
" " <<
dec<<
id.rawId()<<
"\n" ;
1253 if (!ok) ss <<
"Quadrant="<<
id.iquadrant()<<
" xt="<<
id.ic()<<
" " <<
dec<<
id.rawId()<<
"\n" ;
1255 linEtaSlice[etaSlice] = lin ;
1260 for (vector<DetId>::const_iterator it = eeCells.begin(); it != eeCells.end(); ++it) {
1267 towerListEE.push_back(towid.
rawId()) ;
1271 towerListEE.push_back(additionalTower.rawId()) ;
1273 stripListEE.push_back(elId.
rawId() & 0xfffffff8) ;
1274 int dccNb = Id.
dccId() ;
1281 int xtalInVFE = Id.
xtalId() ;
1282 int xtalWithinCCUid = 5*(VFEid-1) + xtalInVFE -1 ;
1283 int etaSlice = towid.
ietaAbs() ;
1290 int iz =
id.positiveZ() ;
1291 if (iz ==0) iz = -1 ;
1292 for (
int k=0;
k<(
int)my_CrystalEcalLogicId_EE.size();
k++) {
1293 int z= my_CrystalEcalLogicId_EE[
k].getID1() ;
1294 int x= my_CrystalEcalLogicId_EE[
k].getID2() ;
1295 int y= my_CrystalEcalLogicId_EE[
k].getID3() ;
1296 if (
id.ix()==x &&
id.iy()==y && iz==z) logicId=my_CrystalEcalLogicId_EE[
k];
1304 getCoeff(coeff, calibMap, laserAlphaMap,
id.rawId(), str) ;
1306 getCoeff(coeff, gainMap,
id.rawId()) ;
1307 getCoeff(coeff, pedMap,
id.rawId()) ;
1309 else ICEEMinus->Fill(
id.ix(),
id.iy(), coeff.
calibCoeff_) ;
1312 vector<int> xtalCCU ;
1313 xtalCCU.push_back(dccNb+600) ;
1314 xtalCCU.push_back(CCUid) ;
1315 xtalCCU.push_back(xtalWithinCCUid) ;
1316 xtalCCU.push_back(
id.rawId()) ;
1321 map<int, linStruc>::const_iterator itLin = linEtaSlice.find(etaSlice);
1322 if (itLin != linEtaSlice.end()) {
1323 linMap[xtalCCU] = itLin->second ;
1325 for (
int i=0 ;
i<3 ;
i++)
1326 (*
out_file_) << hex <<
" 0x"<<itLin->second.pedestal_[
i]<<
" 0x"<<itLin->second.mult_[
i]<<
" 0x"<<itLin->second.shift_[
i]<<std::endl;
1329 for (
int i=0 ;
i<3 ;
i++) {
1336 if (
id.
zside()>0) tpgFactorEEPlus->Fill(
id.ix(),
id.iy(), factor) ;
1337 else tpgFactorEEMinus->Fill(
id.ix(),
id.iy(), factor) ;
1341 else ss <<
"current EtaSlice = "<<etaSlice<<
" not found in the EtaSlice map"<<
"\n";
1346 for (
int i=0 ;
i<3 ;
i++) {
1349 if (!ok)
edm::LogError(
"TopInfo") <<
"unable to compute the parameters for "<<
dec<<
id.rawId()<<
"\n" ;
1359 if (!ok) ss <<
"Quadrant="<<
id.iquadrant()<<
" xt="<<
id.ic()<<
" " <<
dec<<
id.rawId()<<
"\n" ;
1361 for (
int i=0 ;
i<3 ;
i++) {
1370 if (
id.
zside()>0) tpgFactorEEPlus->Fill(
id.ix(),
id.iy(), factor) ;
1371 else tpgFactorEEMinus->Fill(
id.ix(),
id.iy(), factor) ;
1376 linMap[xtalCCU] = lin ;
1379 pedset[logicId] = pedDB ;
1380 linset[logicId] = linDB ;
1390 linparamset[my_EcalLogicId_EE] = linparam ;
1396 lutparamset[my_EcalLogicId_EE] = lutparam ;
1402 fgrparamset[my_EcalLogicId_EE] = fgrparam ;
1411 ss <<
" LIN tag "<<lin_tag<<
"\n";
1416 ss <<
"the ped id ="<<
ped_conf_id_<<
" will be used for the pedestals "<<
"\n";
1426 evgueni<<
"void getLinParamTPG_hardcoded(int fed, int ccu, int xtal,"<<endl ;
1427 evgueni<<
" int & mult12, int & shift12, int & base12,"<<endl ;
1428 evgueni<<
" int & mult6, int & shift6, int & base6,"<<endl ;
1429 evgueni<<
" int & mult1, int & shift1, int & base1)"<<endl ;
1431 evgueni<<
" mult12 = 0 ; shift12 = 0 ; base12 = 0 ; mult6 = 0 ; shift6 = 0 ; base6 = 0 ; mult1 = 0 ; shift1 = 0 ; base1 = 0 ;"<<endl ;
1432 map< vector<int>,
linStruc>::const_iterator itLinMap ;
1433 for (itLinMap = linMap.begin() ; itLinMap != linMap.end() ; itLinMap++) {
1434 vector<int> xtalInCCU = itLinMap->first ;
1435 evgueni<<
" if (fed=="<<xtalInCCU[0]<<
" && ccu=="<<xtalInCCU[1]<<
" && xtal=="<<xtalInCCU[2]<<
") {" ;
1436 evgueni<<
" mult12 = "<<itLinMap->second.
mult_[0]<<
" ; shift12 = "<<itLinMap->second.shift_[0]<<
" ; base12 = "<<itLinMap->second.pedestal_[0]<<
" ; " ;
1437 evgueni<<
" mult6 = "<<itLinMap->second.mult_[1]<<
" ; shift6 = "<<itLinMap->second.shift_[1]<<
" ; base6 = "<<itLinMap->second.pedestal_[1]<<
" ; " ;
1438 evgueni<<
" mult1 = "<<itLinMap->second.mult_[2]<<
" ; shift1 = "<<itLinMap->second.shift_[2]<<
" ; base1 = "<<itLinMap->second.pedestal_[2]<<
" ; " ;
1439 evgueni<<
" return ;}" <<endl ;
1441 evgueni<<
"}" <<endl ;
1450 const int NWEIGROUPS = 2 ;
1451 std::vector<unsigned int>
weights[NWEIGROUPS] ;
1459 map<EcalLogicID, FEConfigWeightGroupDat>
dataset;
1461 for (
int igrp=0 ; igrp<NWEIGROUPS ; igrp++) {
1463 if (weights[igrp].
size() == 5) {
1466 (*out_file_) <<std::endl ;
1467 (*out_file_) <<
"WEIGHT "<<igrp<<endl ;
1469 (*out_file_)<<std::endl ;
1470 (*out_file_) <<std::endl ;
1473 ss <<
"going to write the weights for groupe:"<<igrp<<
"\n";
1484 dataset[ecid] = gut;
1492 map<EcalLogicID, FEConfigWeightDat> dataset2;
1495 for (
int ich=0; ich<(
int)my_StripEcalLogicId.size() ; ich++){
1499 dataset2[my_StripEcalLogicId[ich]] = wut;
1503 for (
int ich=0; ich<(
int)my_StripEcalLogicId1_EE.size() ; ich++){
1508 dataset2[my_StripEcalLogicId1_EE[ich]] = wut;
1511 for (
int ich=0; ich<(
int)my_StripEcalLogicId2_EE.size() ; ich++){
1516 dataset2[my_StripEcalLogicId2_EE[ich]] = wut;
1521 wtag.str(
""); wtag<<
"Shape_NGroups_"<<NWEIGROUPS;
1523 ss <<
" weight tag "<<weight_tag<<
"\n";
1534 unsigned int lowRatio, highRatio, lowThreshold, highThreshold, lutFG ;
1537 (*out_file_) <<std::endl ;
1538 (*out_file_) <<
"FG 0"<<std::endl ;
1539 (*out_file_)<<hex<<
"0x"<<lowThreshold<<
" 0x"<<highThreshold
1540 <<
" 0x"<<lowRatio<<
" 0x"<<highRatio<<
" 0x"<<lutFG
1546 unsigned int lut_strip;
1553 ss <<
"going to write the fgr "<<
"\n";
1554 map<EcalLogicID, FEConfigFgrGroupDat>
dataset;
1557 for (
int ich=0; ich<NFGRGROUPS; ich++){
1567 dataset[ecid] = gut;
1571 map<EcalLogicID, FEConfigFgrDat> dataset2;
1573 for (
int ich=0; ich<(
int)my_TTEcalLogicId.size() ; ich++){
1580 dataset2[my_TTEcalLogicId[ich]] = wut;
1584 for (
int ich=0; ich<(
int)my_RTEcalLogicId_EE.size() ; ich++){
1592 dataset2[my_RTEcalLogicId_EE[ich]] = wut;
1596 map<EcalLogicID, FEConfigFgrEETowerDat> dataset3;
1597 for (
int ich=0; ich<(
int)my_TTEcalLogicId_EE.size() ; ich++){
1600 dataset3[my_TTEcalLogicId_EE[ich]]=fgreett;
1605 map<EcalLogicID, FEConfigFgrEEStripDat> dataset4;
1606 for (
int ich=0; ich<(
int)my_StripEcalLogicId1_EE.size() ; ich++){
1610 dataset4[my_StripEcalLogicId1_EE[ich]] = zut;
1612 for (
int ich=0; ich<(
int)my_StripEcalLogicId2_EE.size() ; ich++){
1617 dataset4[my_StripEcalLogicId2_EE[ich]] = zut;
1619 for (
int ich=0; ich<(
int)my_StripEcalLogicId.size() ; ich++){
1623 uint32_t elStripId = stripMapEB[ich] ;
1624 map<uint32_t, uint32_t>::const_iterator it = stripMapEBsintheta.find(elStripId) ;
1625 if (it != stripMapEBsintheta.end()) zut.
setThreshold(it->second);
1627 edm::LogError(
"TopInfo") <<
"ERROR: strip SFGVB threshold parameter not found for that strip:"<<thestrip.
getID1()<<
" "<<thestrip.
getID3()<<
" "<<thestrip.
getID3()<<
"\n" ;
1633 dataset4[thestrip] = zut;
1640 ss <<
" weight tag "<<weight_tag<<
"\n";
1644 map<EcalLogicID, FEConfigSpikeDat> datasetspike;
1645 for (
int ich=0; ich<(
int)my_TTEcalLogicId.size() ; ich++){
1648 datasetspike[my_TTEcalLogicId[ich]] = spiketh;
1655 ss <<
" spike tag "<<spike_tag<<
"\n";
1660 map<EcalLogicID, FEConfigTimingDat> datasetdelay;
1661 for (
int ich=0; ich<(
int)my_TTEcalLogicId_EB_by_TCC.size() ; ich++){
1664 EcalLogicID logiciddelay = my_TTEcalLogicId_EB_by_TCC[ich] ;
1665 int id1_tcc=my_TTEcalLogicId_EB_by_TCC[ich].
getID1();
1666 int id2_tt =my_TTEcalLogicId_EB_by_TCC[ich].getID2();
1667 std::map<int, vector<int> >::const_iterator ittEB =
delays_EB_.find(id1_tcc);
1668 std::vector<int> TimingDelaysEB = ittEB->second;
1671 if(TimingDelaysEB[id2_tt-1] == -1){
1672 edm::LogError(
"TopInfo") <<
"ERROR: Barrel timing delay not specified, check file, putting default value 1" <<
"\n";
1677 edm::LogError(
"TopInfo") <<
"ERROR:Barrel Could not find delay parameter for that trigger tower " <<
"\n";
1678 edm::LogError(
"TopInfo") <<
"Using default value = 1" <<
"\n";
1682 std::map<int, vector<int> >::const_iterator ittpEB =
phases_EB_.find(id1_tcc);
1683 std::vector<int> TimingPhasesEB = ittpEB->second;
1686 if(TimingPhasesEB[id2_tt-1] == -1){
1687 edm::LogError(
"TopInfo") <<
"ERROR: Barrel timing phase not specified, check file, putting default value 0" <<
"\n";
1692 edm::LogError(
"TopInfo") <<
"ERROR:Barrel Could not find phase parameter for that trigger tower " <<
"\n";
1693 edm::LogError(
"TopInfo") <<
"Using default value = 0" <<
"\n";
1697 ss << ich <<
" tcc=" << id1_tcc <<
" TT=" << id2_tt <<
" logicId=" << logiciddelay.
getLogicID()
1698 <<
" delay=" << TimingDelaysEB[id2_tt-1] <<
" phase=" << TimingPhasesEB[id2_tt-1] <<
"\n";
1702 datasetdelay[my_TTEcalLogicId_EB_by_TCC[ich]] = delay;
1708 for (
int ich=0; ich<(
int)my_StripEcalLogicId_EE_strips_by_TCC.size() ; ich++){
1714 EcalLogicID logiciddelay = my_StripEcalLogicId_EE_strips_by_TCC[ich] ;
1715 int id1_tcc=my_StripEcalLogicId_EE_strips_by_TCC[ich].
getID1();
1716 int id2_tt =my_StripEcalLogicId_EE_strips_by_TCC[ich].getID2();
1717 int id3_st =my_StripEcalLogicId_EE_strips_by_TCC[ich].getID3();
1720 if(id1_tcc != tccin) {tccin = id1_tcc; stripindex=0;}
1722 std::map<int, vector<int> >::const_iterator ittEE =
delays_EE_.find(id1_tcc);
1723 std::vector<int> TimingDelaysEE = ittEE->second;
1726 if(TimingDelaysEE[stripindex] == -1){
1727 edm::LogError(
"TopInfo") <<
"ERROR: Endcap timing delay not specified, check file, putting default value 1" <<
"\n";
1732 edm::LogError(
"TopInfo") <<
"ERROR:Endcap Could not find delay parameter for that trigger tower " <<
"\n";
1733 edm::LogError(
"TopInfo") <<
"Using default value = 1" <<
"\n";
1737 std::map<int, vector<int> >::const_iterator ittpEE =
phases_EE_.find(id1_tcc);
1738 std::vector<int> TimingPhasesEE = ittpEE->second;
1741 if(TimingPhasesEE[stripindex] == -1){
1742 edm::LogError(
"TopInfo") <<
"ERROR: Endcap timing phase not specified, check file, putting default value 0" <<
"\n";
1747 edm::LogError(
"TopInfo") <<
"ERROR:Endcap Could not find phase parameter for that trigger tower " <<
"\n";
1748 edm::LogError(
"TopInfo") <<
"Using default value = 0" <<
"\n";
1752 ss << ich <<
" stripindex=" << stripindex <<
" tcc=" << id1_tcc <<
" TT=" << id2_tt <<
" id3_st=" << id3_st
1754 <<
" delay=" << TimingDelaysEE[stripindex] <<
" phase=" << TimingPhasesEE[stripindex] <<
"\n";
1759 datasetdelay[my_StripEcalLogicId_EE_strips_by_TCC[ich]] = delay;
1763 ostringstream de_tag;
1764 de_tag.str(
""); de_tag<<
"DelaysFromFile";
1766 ss <<
" delay tag "<<delay_tag<<
"\n";
1773 ss <<
"going to write the sliding "<<
"\n";
1774 map<EcalLogicID, FEConfigSlidingDat>
dataset;
1776 for (
int ich=0; ich<(
int)my_StripEcalLogicId.size() ; ich++){
1782 dataset[my_StripEcalLogicId[ich]] = wut;
1786 for (
int ich=0; ich<(
int)my_StripEcalLogicId1_EE.size() ; ich++){
1792 dataset[my_StripEcalLogicId1_EE[ich]] = wut;
1794 for (
int ich=0; ich<(
int)my_StripEcalLogicId2_EE.size() ; ich++){
1800 dataset[my_StripEcalLogicId2_EE[ich]] = wut;
1806 wtag.str(
""); wtag<<
"Sliding_"<<
sliding_;
1808 ss <<
" sliding tag "<<justatag<<
"\n";
1821 int lut_EB[1024], lut_EE[1024] ;
1826 (*out_file_) <<std::endl ;
1827 (*out_file_) <<
"LUT 0"<<std::endl ;
1828 for (
int i=0 ;
i<1024 ;
i++) (*
out_file_)<<
"0x"<<hex<<lut_EB[
i]<<endl ;
1829 (*out_file_)<<endl ;
1835 bool newLUT(
false) ;
1836 for (
int i=0 ;
i<1024 ;
i++)
if (lut_EE[
i] != lut_EB[
i]) newLUT =
true ;
1838 (*out_file_) <<std::endl ;
1839 (*out_file_) <<
"LUT 1"<<std::endl ;
1840 for (
int i=0 ; i<1024 ; i++) (*
out_file_)<<
"0x"<<hex<<lut_EE[
i]<<endl ;
1841 (*out_file_)<<endl ;
1850 map<EcalLogicID, FEConfigLUTGroupDat>
dataset;
1856 for (
int i=0; i<1024; i++){
1861 dataset[ecid] =
lut;
1867 for (
int i=0; i<1024; i++){
1872 dataset[ecide] =
lute;
1879 map<EcalLogicID, FEConfigLUTDat> dataset2;
1881 for (
int ich=0; ich<(
int)my_TTEcalLogicId.size() ; ich++){
1887 dataset2[my_TTEcalLogicId[ich]] =
lut;
1891 for (
int ich=0; ich<(
int)my_TTEcalLogicId_EE.size() ; ich++){
1897 dataset2[my_TTEcalLogicId_EE[ich]] =
lut;
1902 ltag.str(
""); ltag<<
LUT_option_<<
"_NGroups_"<<NLUTGROUPS;
1904 ss <<
" LUT tag "<<lut_tag<<
"\n";
1917 ss <<
"\n Conf ID = " << conf_id_ <<
"\n";
1926 stripListEB.sort() ;
1927 stripListEB.unique() ;
1928 ss <<
"Number of EB strips="<<
dec<<stripListEB.size()<<
"\n" ;
1930 (*out_file_) <<std::endl ;
1931 for (itList = stripListEB.begin(); itList != stripListEB.end(); itList++ ) {
1932 (*out_file_) <<
"STRIP_EB "<<
dec<<(*itList)<<endl ;
1933 (*out_file_) << hex <<
"0x" <<
sliding_<<std::endl ;
1934 (*out_file_) <<
"0" <<std::endl ;
1935 (*out_file_) <<
"0x"<<stripMapEBsintheta[(*itList)] <<
" 0x" <<
SFGVB_lut_ <<std::endl ;
1940 stripListEE.sort() ;
1941 stripListEE.unique() ;
1942 ss <<
"Number of EE strips="<<
dec<<stripListEE.size()<<
"\n" ;
1944 (*out_file_) <<std::endl ;
1945 for (itList = stripListEE.begin(); itList != stripListEE.end(); itList++ ) {
1946 (*out_file_) <<
"STRIP_EE "<<
dec<<(*itList)<<endl ;
1947 (*out_file_) << hex <<
"0x" <<
sliding_<<std::endl ;
1949 (*out_file_) <<
" 1" << std::endl ;
1950 (*out_file_)<<hex<<
"0x"<<threshold<<
" 0x"<<lut_strip<<std::endl ;
1962 towerListEB.sort() ;
1963 towerListEB.unique() ;
1964 ss <<
"Number of EB towers="<<
dec<<towerListEB.size()<<
"\n" ;
1966 (*out_file_) <<std::endl ;
1967 for (itList = towerListEB.begin(); itList != towerListEB.end(); itList++ ) {
1968 (*out_file_) <<
"TOWER_EB "<<
dec<<(*itList)<<endl ;
1969 (*out_file_) <<
" 0\n 0\n" ;
1975 towerListEE.sort() ;
1976 towerListEE.unique() ;
1977 ss <<
"Number of EE towers="<<
dec<<towerListEE.size()<<
"\n" ;
1979 (*out_file_) <<std::endl ;
1980 for (itList = towerListEE.begin(); itList != towerListEE.end(); itList++ ) {
1981 (*out_file_) <<
"TOWER_EE "<<
dec<<(*itList)<<endl ;
1982 if (newLUT) (*out_file_) <<
" 1\n" ;
1984 (*out_file_)<<hex<<
"0x"<<lut_tower<<std::endl ;
1996 tpgFactorEB->Write() ;
1998 tpgFactorEEPlus->Write() ;
1999 ICEEMinus->Write() ;
2000 tpgFactorEEMinus->Write() ;
2002 tpgFactor->Write() ;
2006 ntupleSpike->Write() ;
2012 using namespace edm;
2013 using namespace std;
2023 (*out_file_)<<
"PHYSICS_EB "<<
dec<<eb.
rawId()<<std::endl ;
2028 (*out_file_) <<std::endl ;
2030 (*out_file_)<<
"PHYSICS_EE "<<
dec<<ee.
rawId()<<std::endl ;
2033 <<-1<<
" "<<-1<<std::endl ;
2034 (*out_file_) <<std::endl ;
2074 double factor = 1024 * ratio * gainRatio * calibCoeff *
sin(theta) * (1 << (
sliding_ + shiftDet + 2)) ;
2076 mult = (
int)(factor+0.5) ;
2077 for (shift = 0 ; shift<15 ; shift++) {
2078 if (mult>=128 && mult<256)
return true ;
2080 mult = (
int)(factor+0.5) ;
2082 edm::LogError(
"TopInfo") <<
"too bad we did not manage to calculate the factor for calib=" << calibCoeff <<
"\n";
2089 (*out_file_) <<
"COMMENT put your comments here"<<std::endl ;
2091 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2092 (*out_file_) <<
"COMMENT physics EB structure"<<std::endl ;
2093 (*out_file_) <<
"COMMENT"<<std::endl ;
2094 (*out_file_) <<
"COMMENT EtSaturation (GeV), ttf_threshold_Low (GeV), ttf_threshold_High (GeV)"<<std::endl ;
2095 (*out_file_) <<
"COMMENT FG_lowThreshold (GeV), FG_highThreshold (GeV), FG_lowRatio, FG_highRatio"<<std::endl ;
2097 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2098 (*out_file_) <<
"COMMENT"<<std::endl ;
2100 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2101 (*out_file_) <<
"COMMENT physics EE structure"<<std::endl ;
2102 (*out_file_) <<
"COMMENT"<<std::endl ;
2103 (*out_file_) <<
"COMMENT EtSaturation (GeV), ttf_threshold_Low (GeV), ttf_threshold_High (GeV)"<<std::endl ;
2104 (*out_file_) <<
"COMMENT FG_Threshold (GeV), dummy, dummy, dummy"<<std::endl ;
2105 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2106 (*out_file_) <<
"COMMENT"<<std::endl ;
2108 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2109 (*out_file_) <<
"COMMENT crystal structure (same for EB and EE)"<<std::endl ;
2110 (*out_file_) <<
"COMMENT"<<std::endl ;
2111 (*out_file_) <<
"COMMENT ped, mult, shift [gain12]"<<std::endl ;
2112 (*out_file_) <<
"COMMENT ped, mult, shift [gain6]"<<std::endl ;
2113 (*out_file_) <<
"COMMENT ped, mult, shift [gain1]"<<std::endl ;
2114 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2115 (*out_file_) <<
"COMMENT"<<std::endl ;
2117 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2118 (*out_file_) <<
"COMMENT strip EB structure"<<std::endl ;
2119 (*out_file_) <<
"COMMENT"<<std::endl ;
2120 (*out_file_) <<
"COMMENT sliding_window"<<std::endl ;
2121 (*out_file_) <<
"COMMENT weightGroupId"<<std::endl ;
2122 (*out_file_) <<
"COMMENT threshold_sfg lut_sfg"<<std::endl ;
2123 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2124 (*out_file_) <<
"COMMENT"<<std::endl ;
2126 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2127 (*out_file_) <<
"COMMENT strip EE structure"<<std::endl ;
2128 (*out_file_) <<
"COMMENT"<<std::endl ;
2129 (*out_file_) <<
"COMMENT sliding_window"<<std::endl ;
2130 (*out_file_) <<
"COMMENT weightGroupId"<<std::endl ;
2131 (*out_file_) <<
"COMMENT threshold_fg lut_fg"<<std::endl ;
2132 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2133 (*out_file_) <<
"COMMENT"<<std::endl ;
2135 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2136 (*out_file_) <<
"COMMENT tower EB structure"<<std::endl ;
2137 (*out_file_) <<
"COMMENT"<<std::endl ;
2138 (*out_file_) <<
"COMMENT LUTGroupId"<<std::endl ;
2139 (*out_file_) <<
"COMMENT FgGroupId"<<std::endl ;
2140 (*out_file_) <<
"COMMENT spike_killing_threshold"<<std::endl ;
2141 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2142 (*out_file_) <<
"COMMENT"<<std::endl ;
2144 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2145 (*out_file_) <<
"COMMENT tower EE structure"<<std::endl ;
2146 (*out_file_) <<
"COMMENT"<<std::endl ;
2147 (*out_file_) <<
"COMMENT LUTGroupId"<<std::endl ;
2148 (*out_file_) <<
"COMMENT tower_lut_fg"<<std::endl ;
2149 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2150 (*out_file_) <<
"COMMENT"<<std::endl ;
2152 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2153 (*out_file_) <<
"COMMENT Weight structure"<<std::endl ;
2154 (*out_file_) <<
"COMMENT"<<std::endl ;
2155 (*out_file_) <<
"COMMENT weightGroupId"<<std::endl ;
2156 (*out_file_) <<
"COMMENT w0, w1, w2, w3, w4"<<std::endl ;
2157 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2158 (*out_file_) <<
"COMMENT"<<std::endl ;
2160 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2161 (*out_file_) <<
"COMMENT lut structure"<<std::endl ;
2162 (*out_file_) <<
"COMMENT"<<std::endl ;
2163 (*out_file_) <<
"COMMENT LUTGroupId"<<std::endl ;
2164 (*out_file_) <<
"COMMENT LUT[1-1024]"<<std::endl ;
2165 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2166 (*out_file_) <<
"COMMENT"<<std::endl ;
2168 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2169 (*out_file_) <<
"COMMENT fg EB structure"<<std::endl ;
2170 (*out_file_) <<
"COMMENT"<<std::endl ;
2171 (*out_file_) <<
"COMMENT FgGroupId"<<std::endl ;
2172 (*out_file_) <<
"COMMENT el, eh, tl, th, lut_fg"<<std::endl ;
2173 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2174 (*out_file_) <<
"COMMENT"<<std::endl ;
2176 (*out_file_) <<std::endl ;
2183 unsigned int max = (
unsigned int)(
pow(2.,complement2)-1) ;
2184 if (weight>0) iweight=
int((1<<6)*weight+0.5) ;
2185 else iweight= max -
int(-weight*(1<<6)+0.5) +1 ;
2186 iweight = iweight &
max ;
2191 double weight = double(iweight)/
pow(2., 6.) ;
2193 if ( (iweight & (1<<(complement2-1))) != 0) weight = (double(iweight)-
pow(2., complement2))/
pow(2., 6.) ;
2198 std::ostringstream ss;
2199 ss <<
"Computing Weights...\n" ;
2201 double max = shape(timeMax) ;
2208 sumf += shape(time)/
max ;
2209 sumf2 += shape(time)/max * shape(time)/
max ;
2210 for (
int subtime = 0 ; subtime<25 ; subtime++) histo->Fill(
float(
sample*25. + subtime)/25., shape(time+subtime)) ;
2212 double lambda = 1./(sumf2-sumf*sumf/
nSample_) ;
2222 int * iweight =
new int[
nSample_] ;
2227 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) isumw += iweight[sample] ;
2229 isumw = (isumw & imax ) ;
2233 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) {
2236 ampl += weight[
sample]*shape(time) ;
2238 ss <<
"weight="<<weight[
sample]<<
" shape="<<shape(time)<<
"\n" ;
2241 ss <<
"Weights: sum (weight*shape) = "<<ampl<<
"\n" ;
2248 while (isumw != 0 && count<10) {
2250 unsigned int index = 0 ;
2253 ss <<
"Correcting for bias: adding 1\n" ;
2254 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) {
2255 int new_iweight = iweight[
sample]+1 ;
2257 if (fabs(new_weight-weight[sample])<min) {
2258 min = fabs(new_weight-weight[sample]) ;
2265 ss <<
"Correcting for bias: subtracting 1\n" ;
2266 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) {
2267 int new_iweight = iweight[
sample]-1 ;
2269 if (fabs(new_weight-weight[sample])<min) {
2270 min = fabs(new_weight-weight[sample]) ;
2277 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) isumw += iweight[sample] ;
2279 isumw = (isumw & imax ) ;
2280 ss <<
"Correcting weight number: "<< index <<
" sum weights = " << isumw<<
"\n" ;
2287 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) isumw += iweight[sample] ;
2289 isumw = (isumw & imax ) ;
2291 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) {
2296 ampl += new_weight*shape(time) ;
2297 ss <<
"weight unbiased after integer conversion="<<new_weight<<
" shape="<<shape(time)<<
"\n" ;
2300 ss <<
"Weights: sum (weight*shape) = "<<ampl<<
"\n" ;
2303 std::vector<unsigned int> theWeights ;
2304 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) theWeights.push_back(iweight[sample]) ;
2331 for (
int i=0 ;
i<1024 ;
i++) {
2333 if (lut[
i]>0xff) lut[
i] = 0xff ;
2339 for (
int i=0 ;
i<1024 ;
i++) {
2341 if ((
i+1)%4 == 0 ) mylut++ ;
2349 func->SetParameters(LUT_stochastic, LUT_noise, LUT_constant) ;
2350 double norm = func->Integral(0., Et_sat) ;
2351 for (
int i=0 ;
i<1024 ;
i++) {
2352 double Et =
i*Et_sat/1024. ;
2353 lut[
i] =
int(0xff*func->Integral(0., Et)/norm + 0.5) ;
2358 for (
int j=0 ; j<1024 ; j++) {
2359 double Et_GeV = Et_sat/1024*(j+0.5) ;
2360 if (Et_GeV <= LUT_threshold) lut[j] = 0 ;
2362 if (Et_GeV >= TTF_highThreshold) ttf = 3 ;
2363 if (Et_GeV >= TTF_lowThreshold && Et_GeV < TTF_highThreshold) ttf = 1 ;
2380 double alpha_factor = 1.0;
2383 icorr = itCorr->second;
2391 st =
"Transparency correction found for xtal " + ss.str() +
" corr=" + ss1.str() +
" intercalib=" + ss2.str() +
"\n";
2394 edm::LogError(
"TopInfo") <<
"ERROR = Transparency correction not found for xtal " << rawId <<
"\n";
2397 DetId ECALdetid(rawId);
2401 st +=
"DETID=" + ss.str() +
"\n";
2405 if ( italpha != laserAlphaMap.
end() ) alpha_factor = (*italpha);
2406 else edm::LogError(
"TopInfo") <<
"ERROR:LaserAlphe parameter note found!!" <<
"\n";
2411 if ( italpha != laserAlphaMap.
end() ) alpha_factor = (*italpha);
2412 else edm::LogError(
"TopInfo") <<
"ERROR:LaserAlphe parameter note found!!" <<
"\n";
2425 ss2 << alpha_factor;
2426 st +=
"rawId " + ss.str() +
" " + ss1.str() +
" " + ss2.str() +
"\n";
2429 else edm::LogError(
"TopInfo") <<
"getCoeff: "<<rawId<<
" not found in EcalIntercalibConstantMap"<<
"\n" ;
2439 if (gainIter != gainMap.
end()) {
2444 else edm::LogError(
"TopInfo") <<
"getCoeff: "<<rawId<<
" not found in EcalGainRatioMap"<<
"\n" ;
2462 if (pedIter != pedMap.
end()) {
2468 else edm::LogError(
"TopInfo") <<
"getCoeff: " << rawId <<
" not found in EcalPedestalsMap\n" ;
2478 map<EcalLogicID, MonPedestalsDat>::const_iterator it = pedMap.find(logicId);
2479 if (it != pedMap.end()) {
2486 <<
" not found in map<EcalLogicID, MonPedestalsDat\n" ;
2490 unsigned int & lowThreshold,
unsigned int & highThreshold,
unsigned int &
lut)
2493 if (lowRatio>0x7f) lowRatio = 0x7f ;
2495 if (highRatio>0x7f) highRatio = 0x7f ;
2500 if (lowThreshold>0xff) lowThreshold = 0xff ;
2502 if (highThreshold>0xff) highThreshold = 0xff ;
2528 for (
int i=1 ;
i<3 ;
i++) {
2532 }
else base[
i] = 0 ;
2535 for (
int i=0 ;
i<3 ;
i++) {
2539 edm::LogError(
"TopInfo") <<
"WARNING: base= "<<base[
i]<<
", "<<lin.
pedestal_[
i]<<
" for gainId[0-2]="<<
i<<
" ==> forcing at 0"<<
"\n" ;
2550 gctphi = (ttphi+1)/4;
2551 if(ttphi<=2) gctphi=0;
2552 if(ttphi>=71) gctphi=0;
2558 if(tteta>0) gcteta = (tteta-1)/4 + 11;
2559 else if(tteta<0) gcteta = (tteta+1)/4 + 10;
2564 std::stringstream sdet ;
2566 if (tcc>36 && tcc<55) sdet<<
"EB-"<<tcc-36 ;
2567 else if (tcc>=55 && tcc<73) sdet<<
"EB+"<<tcc-54 ;
2568 else if (tcc<=36) sdet<<
"EE-" ;
2571 if (tcc<=36 || tcc>=73) {
2572 if (tcc>=73) tcc-=72 ;
2573 if (tcc==1 || tcc==18 || tcc==19 || tcc==36) sdet<<7 ;
2574 else if (tcc==2 || tcc==3 || tcc==20 || tcc==21) sdet<<8 ;
2575 else if (tcc==4 || tcc==5 || tcc==22 || tcc==23) sdet<<9 ;
2576 else if (tcc==6 || tcc==7 || tcc==24 || tcc==25) sdet<<1 ;
2577 else if (tcc==8 || tcc==9 || tcc==26 || tcc==27) sdet<<2 ;
2578 else if (tcc==10 || tcc==11 || tcc==28 || tcc==29) sdet<<3 ;
2579 else if (tcc==12 || tcc==13 || tcc==30 || tcc==31) sdet<<4 ;
2580 else if (tcc==14 || tcc==15 || tcc==32 || tcc==33) sdet<<5 ;
2581 else if (tcc==16 || tcc==17 || tcc==34 || tcc==35) sdet<<6 ;
2588 std::stringstream crate ;
2593 if (tcc>=40 && tcc<=42) {crate<<
"02d" ; slot = 5 + (tcc-40)*6 ;}
2594 if (tcc>=43 && tcc<=45) {crate<<
"03d" ; slot = 5 + (tcc-43)*6 ;}
2595 if (tcc>=37 && tcc<=39) {crate<<
"04d" ; slot = 5 + (tcc-37)*6 ;}
2596 if (tcc>=52 && tcc<=54) {crate<<
"06d" ; slot = 5 + (tcc-52)*6 ;}
2597 if (tcc>=46 && tcc<=48) {crate<<
"07d" ; slot = 5 + (tcc-46)*6 ;}
2598 if (tcc>=49 && tcc<=51) {crate<<
"08d" ; slot = 5 + (tcc-49)*6 ;}
2599 if (tcc>=58 && tcc<=60) {crate<<
"02h" ; slot = 5 + (tcc-58)*6 ;}
2600 if (tcc>=61 && tcc<=63) {crate<<
"03h" ; slot = 5 + (tcc-61)*6 ;}
2601 if (tcc>=55 && tcc<=57) {crate<<
"04h" ; slot = 5 + (tcc-55)*6 ;}
2602 if (tcc>=70 && tcc<=72) {crate<<
"06h" ; slot = 5 + (tcc-70)*6 ;}
2603 if (tcc>=64 && tcc<=66) {crate<<
"07h" ; slot = 5 + (tcc-64)*6 ;}
2604 if (tcc>=67 && tcc<=69) {crate<<
"08h" ; slot = 5 + (tcc-67)*6 ;}
2606 if (tcc>=76 && tcc<=81) {
2608 if (tcc%2==0) slot = 2 + (tcc-76)*3 ;
2609 else slot = 4 + (tcc-77)*3 ;
2611 if (tcc>=94 && tcc<=99) {
2613 if (tcc%2==0) slot = 3 + (tcc-94)*3 ;
2614 else slot = 5 + (tcc-95)*3 ;
2617 if (tcc>=22 && tcc<=27) {
2619 if (tcc%2==0) slot = 2 + (tcc-22)*3 ;
2620 else slot = 4 + (tcc-23)*3 ;
2622 if (tcc>=4 && tcc<=9) {
2624 if (tcc%2==0) slot = 3 + (tcc-4)*3 ;
2625 else slot = 5 + (tcc-5)*3 ;
2628 if (tcc>=82 && tcc<=87) {
2630 if (tcc%2==0) slot = 2 + (tcc-82)*3 ;
2631 else slot = 4 + (tcc-83)*3 ;
2633 if (tcc>=100 && tcc<=105) {
2635 if (tcc%2==0) slot = 3 + (tcc-100)*3 ;
2636 else slot = 5 + (tcc-101)*3 ;
2639 if (tcc>=28 && tcc<=33) {
2641 if (tcc%2==0) slot = 2 + (tcc-28)*3 ;
2642 else slot = 4 + (tcc-29)*3 ;
2644 if (tcc>=10 && tcc<=15) {
2646 if (tcc%2==0) slot = 3 + (tcc-10)*3 ;
2647 else slot = 5 + (tcc-11)*3 ;
2650 if (tcc==34) {crate<<
"04l" ; slot = 2 ;}
2651 if (tcc==16) {crate<<
"04l" ; slot = 3 ;}
2652 if (tcc==35) {crate<<
"04l" ; slot = 4 ;}
2653 if (tcc==17) {crate<<
"04l" ; slot = 5 ;}
2654 if (tcc==36) {crate<<
"04l" ; slot = 8 ;}
2655 if (tcc==18) {crate<<
"04l" ; slot = 9 ;}
2656 if (tcc==19) {crate<<
"04l" ; slot = 10 ;}
2657 if (tcc==1) {crate<<
"04l" ; slot = 11 ;}
2658 if (tcc==20) {crate<<
"04l" ; slot = 14 ;}
2659 if (tcc==2) {crate<<
"04l" ; slot = 15 ;}
2660 if (tcc==21) {crate<<
"04l" ; slot = 16 ;}
2661 if (tcc==3) {crate<<
"04l" ; slot = 17 ;}
2663 if (tcc==88) {crate<<
"06l" ; slot = 2 ;}
2664 if (tcc==106) {crate<<
"06l" ; slot = 3 ;}
2665 if (tcc==89) {crate<<
"06l" ; slot = 4 ;}
2666 if (tcc==107) {crate<<
"06l" ; slot = 5 ;}
2667 if (tcc==90) {crate<<
"06l" ; slot = 8 ;}
2668 if (tcc==108) {crate<<
"06l" ; slot = 9 ;}
2669 if (tcc==73) {crate<<
"06l" ; slot = 10 ;}
2670 if (tcc==91) {crate<<
"06l" ; slot = 11 ;}
2671 if (tcc==74) {crate<<
"06l" ; slot = 14 ;}
2672 if (tcc==92) {crate<<
"06l" ; slot = 15 ;}
2673 if (tcc==75) {crate<<
"06l" ; slot = 16 ;}
2674 if (tcc==93) {crate<<
"06l" ; slot = 17 ;}
2676 return std::pair< std::string, int > (crate.str(),slot) ;
int writeToConfDB_TPGLinearCoef(const std::map< EcalLogicID, FEConfigLinDat > &linset, const std::map< EcalLogicID, FEConfigLinParamDat > &linparamset, int iovId, std::string tag)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::map< int, std::vector< int > > phases_EB_
bool useTransparencyCorr_
void setThreshLow(float x)
edm::ESHandle< EcalTrigTowerConstituentsMap > eTTmap_
int xtalId() const
get the channel id
void setLUTGroupId(int x)
int stripId() const
get the tower id
void setFGhighratio(float x)
const self & getMap() const
EcalLogicID getEcalLogicID(std::string name, int id1=EcalLogicID::NULLID, int id2=EcalLogicID::NULLID, int id3=EcalLogicID::NULLID, std::string mapsTo="") noexcept(false)
float getPedMeanG1() const
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
double TTF_highThreshold_EB_
void setTimingPar2(int x)
unsigned int SFGVB_Threshold_
std::pair< std::string, int > getCrate(int tcc)
const Items & barrelItems() const
int getGCTRegionPhi(int ttphi)
Sin< T >::type sin(const T &t)
constexpr uint32_t rawId() const
get the raw id
std::string TimingPhases_EE_
std::string getDet(int tcc)
double oneOverEtResolEt(double *x, double *par)
Geom::Theta< T > theta() const
unsigned tccId(DetId const &)
std::string Transparency_Corr_
bool weight_unbias_recovery_
void setFGlowthresh(float x)
int towerId() const
get the tower id
std::map< int, double > Transparency_Correction_
void setRatioHigh(float x)
int iTT(const EcalTrigTowerDetId &id) const
returns the index of a Trigger Tower within its TCC.
int writeToConfDB_TPGSliding(const std::map< EcalLogicID, FEConfigSlidingDat > &sliset, int iovId, std::string tag)
unsigned int FG_lut_tower_EE_
static EEDetId unhashIndex(int hi)
std::string TimingDelays_EE_
int writeToConfDB_Delay(const std::map< EcalLogicID, FEConfigTimingDat > &delaygroupset, std::string tag)
const CaloSubdetectorGeometry * theEndcapGeometry_
double FG_lowThreshold_EB_
int writeToConfDB_TPGMain(int ped, int lin, int lut, int fgr, int sli, int wei, int spi, int tim, int bxt, int btt, int bst, std::string tag, int ver)
std::ofstream * out_file_
void fetchDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *iov) noexcept(false)
std::map< int, std::vector< int > > delays_EB_
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
int channelId() const
get the channel id
int ieta() const
get the tower ieta
void setPedMeanG6(float mean)
int zside() const
get the z-side of the tower (1/-1)
virtual const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const
Get a list of valid detector ids (for the given subdetector)
int TCCid(const EBDetId &id) const
returns the TCCid of an EBDetId
int SFGVB_SpikeKillingThreshold_
std::vector< unsigned int > computeWeights(EcalShapeBase &shape, TH1F *histo)
int hashedIndex(int ieta, int iphi)
EcalElectronicsId getElectronicsId(const DetId &id) const
Get the electronics id for this det id.
double TTF_lowThreshold_EE_
std::string getName() const
void setThreshold(unsigned int mean)
void setPedMeanG1(float mean)
void setThreshHigh(float x)
float getPedMeanG12() const
~EcalTPGParamBuilder() override
std::map< int, std::vector< int > > delays_EE_
std::string TimingDelays_EB_
EcalPedestalsMap::const_iterator EcalPedestalsMapIterator
void setLutFgr(unsigned int mean)
int ietaAbs() const
get the absolute value of the tower ieta
const EcalElectronicsMapping * theMapping_
std::vector< EcalLogicID > getEcalLogicIDSetOrdered(std::string name, int fromId1, int toId1, int fromId2=EcalLogicID::NULLID, int toId2=EcalLogicID::NULLID, int fromId3=EcalLogicID::NULLID, int toId3=EcalLogicID::NULLID, std::string mapsTo="", int orderedBy=EcalLogicID::NULLID) noexcept(false)
void computeLUT(int *lut, std::string det="EB")
bool useTransverseEnergy_
EcalTPGParamBuilder(edm::ParameterSet const &pSet)
void analyze(const edm::Event &evt, const edm::EventSetup &evtSetup) override
void setLUTValue(int i, int x)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
Abs< T >::type abs(const T &t)
EcalTriggerElectronicsId getTriggerElectronicsId(const DetId &id) const
Get the trigger electronics id for this det id.
double LUT_stochastic_EE_
std::ofstream * geomFile_
void setLUTGroupId(int x)
base
Make Sure CMSSW is Setup ##.
void setFgrGroupId(int x)
int pseudoStripId() const
get the tower id
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
void setSpikeThreshold(int x)
float getPedMeanG12() const
void setTimingPar1(int x)
const_iterator begin() const
void insert(std::pair< uint32_t, Item > const &a)
void setRatioLow(float x)
void setFgrGroupId(int x)
int writeToConfDB_Spike(const std::map< EcalLogicID, FEConfigSpikeDat > &spikegroupset, std::string tag)
void computeFineGrainEEParameters(uint &threshold, uint &lut_strip, uint &lut_tower)
bool realignBaseline(linStruc &lin, float forceBase12)
bool computeLinearizerParam(double theta, double gainRatio, double calibCoeff, std::string subdet, int &mult, int &shift)
unsigned int pedestal_offset_
int iphi() const
get the tower iphi
const CaloSubdetectorGeometry * theBarrelGeometry_
bool useInterCalibration_
int writeToConfDB_TPGPedestals(const std::map< EcalLogicID, FEConfigPedDat > &pedset, int iovId, std::string tag)
void setPedMeanG12(float mean)
virtual std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
std::vector< Item >::const_iterator const_iterator
int DCCid(const EBDetId &id) const
returns the DCC of an EBDetId
float gain12Over6() const
float getPedMeanG1() const
float getPedMeanG6() const
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
EcalSubdetector subDet() const
get the subDetector associated to the Trigger Tower
void setConfigTag(std::string x)
void setFGlowratio(float x)
double TTF_highThreshold_EE_
void setSliding(float mean)
std::string TimingPhases_EB_
double LUT_stochastic_EB_
void setTTThreshhigh(float x)
int writeToConfDB_TPGLUT(const std::map< EcalLogicID, FEConfigLUTGroupDat > &lutgroup, const std::map< EcalLogicID, FEConfigLUTDat > &lutdat, const std::map< EcalLogicID, FEConfigLUTParamDat > &lutparamset, int iovId, std::string tag)
void setEventSetup(const edm::EventSetup &evtSetup)
float getPedMeanG6() const
const_iterator find(uint32_t rawId) const
static unsigned int const shift
void setWeightGroupId(int x)
int writeToConfDB_TPGFgr(const std::map< EcalLogicID, FEConfigFgrGroupDat > &lutgroup, const std::map< EcalLogicID, FEConfigFgrDat > &lutdat, const std::map< EcalLogicID, FEConfigFgrParamDat > &fgrparamset, const std::map< EcalLogicID, FEConfigFgrEETowerDat > &dataset3, const std::map< EcalLogicID, FEConfigFgrEEStripDat > &dataset4, int iovId, std::string tag)
unsigned int complement2_
const_iterator end() const
int writeToConfDB_TPGWeight(const std::map< EcalLogicID, FEConfigWeightGroupDat > &lutgroup, const std::map< EcalLogicID, FEConfigWeightDat > &lutdat, int iovId, std::string tag)
int getGCTRegionEta(int tteta)
void setTTThreshlow(float x)
const Items & endcapItems() const
static const int SMCRYSTALMODE
void setWeightGroupId(int x)
unsigned int FG_lut_strip_EE_
int getEtaSlice(int tccId, int towerInTCC)
double FG_highThreshold_EB_
T const * product() const
void setLutValue(int mean)
Ecal trigger electronics identification [32:20] Unused (so far) [19:13] TCC id [12:6] TT id [5:3] pse...
void setFGhighthresh(float x)
Power< A, B >::type pow(const A &a, const B &b)
std::map< int, std::vector< int > > phases_EE_
double TTF_lowThreshold_EB_
bool checkIfOK(EcalPedestals::Item item)
void computeFineGrainEBParameters(uint &lowRatio, uint &highRatio, uint &lowThreshold, uint &highThreshold, uint &lut)
void getCoeff(coeffStruc &coeff, const EcalGainRatioMap &gainMap, uint rawId)
int uncodeWeight(double weight, int complement2=7)