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)
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] ;
1458 map<EcalLogicID, FEConfigWeightGroupDat>
dataset;
1460 for (
int igrp=0 ; igrp<NWEIGROUPS ; igrp++) {
1462 if (weights[igrp].
size() == 5) {
1465 (*out_file_) <<std::endl ;
1466 (*out_file_) <<
"WEIGHT "<<igrp<<endl ;
1468 (*out_file_)<<std::endl ;
1469 (*out_file_) <<std::endl ;
1472 ss <<
"going to write the weights for groupe:"<<igrp<<
"\n";
1483 dataset[ecid] = gut;
1491 map<EcalLogicID, FEConfigWeightDat> dataset2;
1494 for (
int ich=0; ich<(
int)my_StripEcalLogicId.size() ; ich++){
1498 dataset2[my_StripEcalLogicId[ich]] = wut;
1502 for (
int ich=0; ich<(
int)my_StripEcalLogicId1_EE.size() ; ich++){
1507 dataset2[my_StripEcalLogicId1_EE[ich]] = wut;
1510 for (
int ich=0; ich<(
int)my_StripEcalLogicId2_EE.size() ; ich++){
1515 dataset2[my_StripEcalLogicId2_EE[ich]] = wut;
1520 wtag.str(
""); wtag<<
"Shape_NGroups_"<<NWEIGROUPS;
1522 ss <<
" weight tag "<<weight_tag<<
"\n";
1533 unsigned int lowRatio, highRatio, lowThreshold, highThreshold, lutFG ;
1536 (*out_file_) <<std::endl ;
1537 (*out_file_) <<
"FG 0"<<std::endl ;
1538 (*out_file_)<<hex<<
"0x"<<lowThreshold<<
" 0x"<<highThreshold
1539 <<
" 0x"<<lowRatio<<
" 0x"<<highRatio<<
" 0x"<<lutFG
1545 unsigned int lut_strip;
1552 ss <<
"going to write the fgr "<<
"\n";
1553 map<EcalLogicID, FEConfigFgrGroupDat>
dataset;
1556 for (
int ich=0; ich<NFGRGROUPS; ich++){
1566 dataset[ecid] = gut;
1570 map<EcalLogicID, FEConfigFgrDat> dataset2;
1572 for (
int ich=0; ich<(
int)my_TTEcalLogicId.size() ; ich++){
1579 dataset2[my_TTEcalLogicId[ich]] = wut;
1583 for (
int ich=0; ich<(
int)my_RTEcalLogicId_EE.size() ; ich++){
1591 dataset2[my_RTEcalLogicId_EE[ich]] = wut;
1595 map<EcalLogicID, FEConfigFgrEETowerDat> dataset3;
1596 for (
int ich=0; ich<(
int)my_TTEcalLogicId_EE.size() ; ich++){
1599 dataset3[my_TTEcalLogicId_EE[ich]]=fgreett;
1604 map<EcalLogicID, FEConfigFgrEEStripDat> dataset4;
1605 for (
int ich=0; ich<(
int)my_StripEcalLogicId1_EE.size() ; ich++){
1609 dataset4[my_StripEcalLogicId1_EE[ich]] = zut;
1611 for (
int ich=0; ich<(
int)my_StripEcalLogicId2_EE.size() ; ich++){
1616 dataset4[my_StripEcalLogicId2_EE[ich]] = zut;
1618 for (
int ich=0; ich<(
int)my_StripEcalLogicId.size() ; ich++){
1622 uint32_t elStripId = stripMapEB[ich] ;
1623 map<uint32_t, uint32_t>::const_iterator it = stripMapEBsintheta.find(elStripId) ;
1624 if (it != stripMapEBsintheta.end()) zut.
setThreshold(it->second);
1626 edm::LogError(
"TopInfo") <<
"ERROR: strip SFGVB threshold parameter not found for that strip:"<<thestrip.
getID1()<<
" "<<thestrip.
getID3()<<
" "<<thestrip.
getID3()<<
"\n" ;
1632 dataset4[thestrip] = zut;
1639 ss <<
" weight tag "<<weight_tag<<
"\n";
1643 map<EcalLogicID, FEConfigSpikeDat> datasetspike;
1644 for (
int ich=0; ich<(
int)my_TTEcalLogicId.size() ; ich++){
1647 datasetspike[my_TTEcalLogicId[ich]] = spiketh;
1654 ss <<
" spike tag "<<spike_tag<<
"\n";
1659 map<EcalLogicID, FEConfigTimingDat> datasetdelay;
1660 for (
int ich=0; ich<(
int)my_TTEcalLogicId_EB_by_TCC.size() ; ich++){
1663 EcalLogicID logiciddelay = my_TTEcalLogicId_EB_by_TCC[ich] ;
1664 int id1_tcc=my_TTEcalLogicId_EB_by_TCC[ich].
getID1();
1665 int id2_tt =my_TTEcalLogicId_EB_by_TCC[ich].getID2();
1666 std::map<int, vector<int> >::const_iterator ittEB =
delays_EB_.find(id1_tcc);
1667 std::vector<int> TimingDelaysEB = ittEB->second;
1670 if(TimingDelaysEB[id2_tt-1] == -1){
1671 edm::LogError(
"TopInfo") <<
"ERROR: Barrel timing delay not specified, check file, putting default value 1" <<
"\n";
1676 edm::LogError(
"TopInfo") <<
"ERROR:Barrel Could not find delay parameter for that trigger tower " <<
"\n";
1677 edm::LogError(
"TopInfo") <<
"Using default value = 1" <<
"\n";
1681 std::map<int, vector<int> >::const_iterator ittpEB =
phases_EB_.find(id1_tcc);
1682 std::vector<int> TimingPhasesEB = ittpEB->second;
1685 if(TimingPhasesEB[id2_tt-1] == -1){
1686 edm::LogError(
"TopInfo") <<
"ERROR: Barrel timing phase not specified, check file, putting default value 0" <<
"\n";
1691 edm::LogError(
"TopInfo") <<
"ERROR:Barrel Could not find phase parameter for that trigger tower " <<
"\n";
1692 edm::LogError(
"TopInfo") <<
"Using default value = 0" <<
"\n";
1696 ss << ich <<
" tcc=" << id1_tcc <<
" TT=" << id2_tt <<
" logicId=" << logiciddelay.
getLogicID()
1697 <<
" delay=" << TimingDelaysEB[id2_tt-1] <<
" phase=" << TimingPhasesEB[id2_tt-1] <<
"\n";
1701 datasetdelay[my_TTEcalLogicId_EB_by_TCC[ich]] = delay;
1707 for (
int ich=0; ich<(
int)my_StripEcalLogicId_EE_strips_by_TCC.size() ; ich++){
1713 EcalLogicID logiciddelay = my_StripEcalLogicId_EE_strips_by_TCC[ich] ;
1714 int id1_tcc=my_StripEcalLogicId_EE_strips_by_TCC[ich].
getID1();
1715 int id2_tt =my_StripEcalLogicId_EE_strips_by_TCC[ich].getID2();
1716 int id3_st =my_StripEcalLogicId_EE_strips_by_TCC[ich].getID3();
1719 if(id1_tcc != tccin) {tccin = id1_tcc; stripindex=0;}
1721 std::map<int, vector<int> >::const_iterator ittEE =
delays_EE_.find(id1_tcc);
1722 std::vector<int> TimingDelaysEE = ittEE->second;
1725 if(TimingDelaysEE[stripindex] == -1){
1726 edm::LogError(
"TopInfo") <<
"ERROR: Endcap timing delay not specified, check file, putting default value 1" <<
"\n";
1731 edm::LogError(
"TopInfo") <<
"ERROR:Endcap Could not find delay parameter for that trigger tower " <<
"\n";
1732 edm::LogError(
"TopInfo") <<
"Using default value = 1" <<
"\n";
1736 std::map<int, vector<int> >::const_iterator ittpEE =
phases_EE_.find(id1_tcc);
1737 std::vector<int> TimingPhasesEE = ittpEE->second;
1740 if(TimingPhasesEE[stripindex] == -1){
1741 edm::LogError(
"TopInfo") <<
"ERROR: Endcap timing phase not specified, check file, putting default value 0" <<
"\n";
1746 edm::LogError(
"TopInfo") <<
"ERROR:Endcap Could not find phase parameter for that trigger tower " <<
"\n";
1747 edm::LogError(
"TopInfo") <<
"Using default value = 0" <<
"\n";
1751 ss << ich <<
" stripindex=" << stripindex <<
" tcc=" << id1_tcc <<
" TT=" << id2_tt <<
" id3_st=" << id3_st
1753 <<
" delay=" << TimingDelaysEE[stripindex] <<
" phase=" << TimingPhasesEE[stripindex] <<
"\n";
1758 datasetdelay[my_StripEcalLogicId_EE_strips_by_TCC[ich]] = delay;
1762 ostringstream de_tag;
1763 de_tag.str(
""); de_tag<<
"DelaysFromFile";
1765 ss <<
" delay tag "<<delay_tag<<
"\n";
1772 ss <<
"going to write the sliding "<<
"\n";
1773 map<EcalLogicID, FEConfigSlidingDat>
dataset;
1775 for (
int ich=0; ich<(
int)my_StripEcalLogicId.size() ; ich++){
1781 dataset[my_StripEcalLogicId[ich]] = wut;
1785 for (
int ich=0; ich<(
int)my_StripEcalLogicId1_EE.size() ; ich++){
1791 dataset[my_StripEcalLogicId1_EE[ich]] = wut;
1793 for (
int ich=0; ich<(
int)my_StripEcalLogicId2_EE.size() ; ich++){
1799 dataset[my_StripEcalLogicId2_EE[ich]] = wut;
1805 wtag.str(
""); wtag<<
"Sliding_"<<
sliding_;
1807 ss <<
" sliding tag "<<justatag<<
"\n";
1820 int lut_EB[1024], lut_EE[1024] ;
1825 (*out_file_) <<std::endl ;
1826 (*out_file_) <<
"LUT 0"<<std::endl ;
1827 for (
int i=0 ;
i<1024 ;
i++) (*
out_file_)<<
"0x"<<hex<<lut_EB[
i]<<endl ;
1828 (*out_file_)<<endl ;
1834 bool newLUT(
false) ;
1835 for (
int i=0 ;
i<1024 ;
i++)
if (lut_EE[
i] != lut_EB[
i]) newLUT =
true ;
1837 (*out_file_) <<std::endl ;
1838 (*out_file_) <<
"LUT 1"<<std::endl ;
1839 for (
int i=0 ; i<1024 ; i++) (*
out_file_)<<
"0x"<<hex<<lut_EE[
i]<<endl ;
1840 (*out_file_)<<endl ;
1849 map<EcalLogicID, FEConfigLUTGroupDat>
dataset;
1855 for (
int i=0; i<1024; i++){
1860 dataset[ecid] =
lut;
1866 for (
int i=0; i<1024; i++){
1871 dataset[ecide] =
lute;
1878 map<EcalLogicID, FEConfigLUTDat> dataset2;
1880 for (
int ich=0; ich<(
int)my_TTEcalLogicId.size() ; ich++){
1886 dataset2[my_TTEcalLogicId[ich]] =
lut;
1890 for (
int ich=0; ich<(
int)my_TTEcalLogicId_EE.size() ; ich++){
1896 dataset2[my_TTEcalLogicId_EE[ich]] =
lut;
1901 ltag.str(
""); ltag<<
LUT_option_<<
"_NGroups_"<<NLUTGROUPS;
1903 ss <<
" LUT tag "<<lut_tag<<
"\n";
1916 ss <<
"\n Conf ID = " << conf_id_ <<
"\n";
1925 stripListEB.sort() ;
1926 stripListEB.unique() ;
1927 ss <<
"Number of EB strips="<<
dec<<stripListEB.size()<<
"\n" ;
1929 (*out_file_) <<std::endl ;
1930 for (itList = stripListEB.begin(); itList != stripListEB.end(); itList++ ) {
1931 (*out_file_) <<
"STRIP_EB "<<
dec<<(*itList)<<endl ;
1932 (*out_file_) << hex <<
"0x" <<
sliding_<<std::endl ;
1933 (*out_file_) <<
"0" <<std::endl ;
1934 (*out_file_) <<
"0x"<<stripMapEBsintheta[(*itList)] <<
" 0x" <<
SFGVB_lut_ <<std::endl ;
1939 stripListEE.sort() ;
1940 stripListEE.unique() ;
1941 ss <<
"Number of EE strips="<<
dec<<stripListEE.size()<<
"\n" ;
1943 (*out_file_) <<std::endl ;
1944 for (itList = stripListEE.begin(); itList != stripListEE.end(); itList++ ) {
1945 (*out_file_) <<
"STRIP_EE "<<
dec<<(*itList)<<endl ;
1946 (*out_file_) << hex <<
"0x" <<
sliding_<<std::endl ;
1948 (*out_file_) <<
" 1" << std::endl ;
1949 (*out_file_)<<hex<<
"0x"<<threshold<<
" 0x"<<lut_strip<<std::endl ;
1961 towerListEB.sort() ;
1962 towerListEB.unique() ;
1963 ss <<
"Number of EB towers="<<
dec<<towerListEB.size()<<
"\n" ;
1965 (*out_file_) <<std::endl ;
1966 for (itList = towerListEB.begin(); itList != towerListEB.end(); itList++ ) {
1967 (*out_file_) <<
"TOWER_EB "<<
dec<<(*itList)<<endl ;
1968 (*out_file_) <<
" 0\n 0\n" ;
1974 towerListEE.sort() ;
1975 towerListEE.unique() ;
1976 ss <<
"Number of EE towers="<<
dec<<towerListEE.size()<<
"\n" ;
1978 (*out_file_) <<std::endl ;
1979 for (itList = towerListEE.begin(); itList != towerListEE.end(); itList++ ) {
1980 (*out_file_) <<
"TOWER_EE "<<
dec<<(*itList)<<endl ;
1981 if (newLUT) (*out_file_) <<
" 1\n" ;
1983 (*out_file_)<<hex<<
"0x"<<lut_tower<<std::endl ;
1995 tpgFactorEB->Write() ;
1997 tpgFactorEEPlus->Write() ;
1998 ICEEMinus->Write() ;
1999 tpgFactorEEMinus->Write() ;
2001 tpgFactor->Write() ;
2005 ntupleSpike->Write() ;
2011 using namespace edm;
2012 using namespace std;
2022 (*out_file_)<<
"PHYSICS_EB "<<
dec<<eb.
rawId()<<std::endl ;
2027 (*out_file_) <<std::endl ;
2029 (*out_file_)<<
"PHYSICS_EE "<<
dec<<ee.
rawId()<<std::endl ;
2032 <<-1<<
" "<<-1<<std::endl ;
2033 (*out_file_) <<std::endl ;
2073 double factor = 1024 * ratio * gainRatio * calibCoeff *
sin(theta) * (1 << (
sliding_ + shiftDet + 2)) ;
2075 mult = (
int)(factor+0.5) ;
2076 for (shift = 0 ; shift<15 ; shift++) {
2077 if (mult>=128 && mult<256)
return true ;
2079 mult = (
int)(factor+0.5) ;
2081 edm::LogError(
"TopInfo") <<
"too bad we did not manage to calculate the factor for calib=" << calibCoeff <<
"\n";
2088 (*out_file_) <<
"COMMENT put your comments here"<<std::endl ;
2090 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2091 (*out_file_) <<
"COMMENT physics EB structure"<<std::endl ;
2092 (*out_file_) <<
"COMMENT"<<std::endl ;
2093 (*out_file_) <<
"COMMENT EtSaturation (GeV), ttf_threshold_Low (GeV), ttf_threshold_High (GeV)"<<std::endl ;
2094 (*out_file_) <<
"COMMENT FG_lowThreshold (GeV), FG_highThreshold (GeV), FG_lowRatio, FG_highRatio"<<std::endl ;
2096 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2097 (*out_file_) <<
"COMMENT"<<std::endl ;
2099 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2100 (*out_file_) <<
"COMMENT physics EE structure"<<std::endl ;
2101 (*out_file_) <<
"COMMENT"<<std::endl ;
2102 (*out_file_) <<
"COMMENT EtSaturation (GeV), ttf_threshold_Low (GeV), ttf_threshold_High (GeV)"<<std::endl ;
2103 (*out_file_) <<
"COMMENT FG_Threshold (GeV), dummy, dummy, dummy"<<std::endl ;
2104 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2105 (*out_file_) <<
"COMMENT"<<std::endl ;
2107 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2108 (*out_file_) <<
"COMMENT crystal structure (same for EB and EE)"<<std::endl ;
2109 (*out_file_) <<
"COMMENT"<<std::endl ;
2110 (*out_file_) <<
"COMMENT ped, mult, shift [gain12]"<<std::endl ;
2111 (*out_file_) <<
"COMMENT ped, mult, shift [gain6]"<<std::endl ;
2112 (*out_file_) <<
"COMMENT ped, mult, shift [gain1]"<<std::endl ;
2113 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2114 (*out_file_) <<
"COMMENT"<<std::endl ;
2116 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2117 (*out_file_) <<
"COMMENT strip EB structure"<<std::endl ;
2118 (*out_file_) <<
"COMMENT"<<std::endl ;
2119 (*out_file_) <<
"COMMENT sliding_window"<<std::endl ;
2120 (*out_file_) <<
"COMMENT weightGroupId"<<std::endl ;
2121 (*out_file_) <<
"COMMENT threshold_sfg lut_sfg"<<std::endl ;
2122 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2123 (*out_file_) <<
"COMMENT"<<std::endl ;
2125 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2126 (*out_file_) <<
"COMMENT strip EE structure"<<std::endl ;
2127 (*out_file_) <<
"COMMENT"<<std::endl ;
2128 (*out_file_) <<
"COMMENT sliding_window"<<std::endl ;
2129 (*out_file_) <<
"COMMENT weightGroupId"<<std::endl ;
2130 (*out_file_) <<
"COMMENT threshold_fg lut_fg"<<std::endl ;
2131 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2132 (*out_file_) <<
"COMMENT"<<std::endl ;
2134 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2135 (*out_file_) <<
"COMMENT tower EB structure"<<std::endl ;
2136 (*out_file_) <<
"COMMENT"<<std::endl ;
2137 (*out_file_) <<
"COMMENT LUTGroupId"<<std::endl ;
2138 (*out_file_) <<
"COMMENT FgGroupId"<<std::endl ;
2139 (*out_file_) <<
"COMMENT spike_killing_threshold"<<std::endl ;
2140 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2141 (*out_file_) <<
"COMMENT"<<std::endl ;
2143 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2144 (*out_file_) <<
"COMMENT tower EE structure"<<std::endl ;
2145 (*out_file_) <<
"COMMENT"<<std::endl ;
2146 (*out_file_) <<
"COMMENT LUTGroupId"<<std::endl ;
2147 (*out_file_) <<
"COMMENT tower_lut_fg"<<std::endl ;
2148 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2149 (*out_file_) <<
"COMMENT"<<std::endl ;
2151 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2152 (*out_file_) <<
"COMMENT Weight structure"<<std::endl ;
2153 (*out_file_) <<
"COMMENT"<<std::endl ;
2154 (*out_file_) <<
"COMMENT weightGroupId"<<std::endl ;
2155 (*out_file_) <<
"COMMENT w0, w1, w2, w3, w4"<<std::endl ;
2156 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2157 (*out_file_) <<
"COMMENT"<<std::endl ;
2159 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2160 (*out_file_) <<
"COMMENT lut structure"<<std::endl ;
2161 (*out_file_) <<
"COMMENT"<<std::endl ;
2162 (*out_file_) <<
"COMMENT LUTGroupId"<<std::endl ;
2163 (*out_file_) <<
"COMMENT LUT[1-1024]"<<std::endl ;
2164 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2165 (*out_file_) <<
"COMMENT"<<std::endl ;
2167 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2168 (*out_file_) <<
"COMMENT fg EB structure"<<std::endl ;
2169 (*out_file_) <<
"COMMENT"<<std::endl ;
2170 (*out_file_) <<
"COMMENT FgGroupId"<<std::endl ;
2171 (*out_file_) <<
"COMMENT el, eh, tl, th, lut_fg"<<std::endl ;
2172 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2173 (*out_file_) <<
"COMMENT"<<std::endl ;
2175 (*out_file_) <<std::endl ;
2182 unsigned int max = (
unsigned int)(
pow(2.,complement2)-1) ;
2183 if (weight>0) iweight=
int((1<<6)*weight+0.5) ;
2184 else iweight= max -
int(-weight*(1<<6)+0.5) +1 ;
2185 iweight = iweight &
max ;
2190 double weight = double(iweight)/
pow(2., 6.) ;
2192 if ( (iweight & (1<<(complement2-1))) != 0) weight = (double(iweight)-
pow(2., complement2))/
pow(2., 6.) ;
2197 std::ostringstream ss;
2198 ss <<
"Computing Weights...\n" ;
2200 double max = shape(timeMax) ;
2207 sumf += shape(time)/
max ;
2208 sumf2 += shape(time)/max * shape(time)/
max ;
2209 for (
int subtime = 0 ; subtime<25 ; subtime++) histo->Fill(
float(
sample*25. + subtime)/25., shape(time+subtime)) ;
2211 double lambda = 1./(sumf2-sumf*sumf/
nSample_) ;
2221 int * iweight =
new int[
nSample_] ;
2226 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) isumw += iweight[sample] ;
2228 isumw = (isumw & imax ) ;
2232 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) {
2235 ampl += weight[
sample]*shape(time) ;
2237 ss <<
"weight="<<weight[
sample]<<
" shape="<<shape(time)<<
"\n" ;
2240 ss <<
"Weights: sum (weight*shape) = "<<ampl<<
"\n" ;
2247 while (isumw != 0 && count<10) {
2249 unsigned int index = 0 ;
2252 ss <<
"Correcting for bias: adding 1\n" ;
2253 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) {
2254 int new_iweight = iweight[
sample]+1 ;
2256 if (fabs(new_weight-weight[sample])<min) {
2257 min = fabs(new_weight-weight[sample]) ;
2264 ss <<
"Correcting for bias: subtracting 1\n" ;
2265 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) {
2266 int new_iweight = iweight[
sample]-1 ;
2268 if (fabs(new_weight-weight[sample])<min) {
2269 min = fabs(new_weight-weight[sample]) ;
2276 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) isumw += iweight[sample] ;
2278 isumw = (isumw & imax ) ;
2279 ss <<
"Correcting weight number: "<< index <<
" sum weights = " << isumw<<
"\n" ;
2286 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) isumw += iweight[sample] ;
2288 isumw = (isumw & imax ) ;
2290 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) {
2295 ampl += new_weight*shape(time) ;
2296 ss <<
"weight unbiased after integer conversion="<<new_weight<<
" shape="<<shape(time)<<
"\n" ;
2299 ss <<
"Weights: sum (weight*shape) = "<<ampl<<
"\n" ;
2302 std::vector<unsigned int> theWeights ;
2303 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) theWeights.push_back(iweight[sample]) ;
2330 for (
int i=0 ;
i<1024 ;
i++) {
2332 if (lut[
i]>0xff) lut[
i] = 0xff ;
2338 for (
int i=0 ;
i<1024 ;
i++) {
2340 if ((
i+1)%4 == 0 ) mylut++ ;
2348 func->SetParameters(LUT_stochastic, LUT_noise, LUT_constant) ;
2349 double norm = func->Integral(0., Et_sat) ;
2350 for (
int i=0 ;
i<1024 ;
i++) {
2351 double Et =
i*Et_sat/1024. ;
2352 lut[
i] =
int(0xff*func->Integral(0., Et)/norm + 0.5) ;
2357 for (
int j=0 ; j<1024 ; j++) {
2358 double Et_GeV = Et_sat/1024*(j+0.5) ;
2359 if (Et_GeV <= LUT_threshold) lut[j] = 0 ;
2361 if (Et_GeV >= TTF_highThreshold) ttf = 3 ;
2362 if (Et_GeV >= TTF_lowThreshold && Et_GeV < TTF_highThreshold) ttf = 1 ;
2379 double alpha_factor = 1.0;
2382 icorr = itCorr->second;
2390 st =
"Transparency correction found for xtal " + ss.str() +
" corr=" + ss1.str() +
" intercalib=" + ss2.str() +
"\n";
2393 edm::LogError(
"TopInfo") <<
"ERROR = Transparency correction not found for xtal " << rawId <<
"\n";
2396 DetId ECALdetid(rawId);
2400 st +=
"DETID=" + ss.str() +
"\n";
2404 if ( italpha != laserAlphaMap.
end() ) alpha_factor = (*italpha);
2405 else edm::LogError(
"TopInfo") <<
"ERROR:LaserAlphe parameter note found!!" <<
"\n";
2410 if ( italpha != laserAlphaMap.
end() ) alpha_factor = (*italpha);
2411 else edm::LogError(
"TopInfo") <<
"ERROR:LaserAlphe parameter note found!!" <<
"\n";
2424 ss2 << alpha_factor;
2425 st +=
"rawId " + ss.str() +
" " + ss1.str() +
" " + ss2.str() +
"\n";
2428 else edm::LogError(
"TopInfo") <<
"getCoeff: "<<rawId<<
" not found in EcalIntercalibConstantMap"<<
"\n" ;
2438 if (gainIter != gainMap.
end()) {
2443 else edm::LogError(
"TopInfo") <<
"getCoeff: "<<rawId<<
" not found in EcalGainRatioMap"<<
"\n" ;
2461 if (pedIter != pedMap.
end()) {
2467 else edm::LogError(
"TopInfo") <<
"getCoeff: " << rawId <<
" not found in EcalPedestalsMap\n" ;
2477 map<EcalLogicID, MonPedestalsDat>::const_iterator it = pedMap.find(logicId);
2478 if (it != pedMap.end()) {
2485 <<
" not found in map<EcalLogicID, MonPedestalsDat\n" ;
2489 unsigned int & lowThreshold,
unsigned int & highThreshold,
unsigned int &
lut)
2492 if (lowRatio>0x7f) lowRatio = 0x7f ;
2494 if (highRatio>0x7f) highRatio = 0x7f ;
2499 if (lowThreshold>0xff) lowThreshold = 0xff ;
2501 if (highThreshold>0xff) highThreshold = 0xff ;
2527 for (
int i=1 ;
i<3 ;
i++) {
2531 }
else base[
i] = 0 ;
2534 for (
int i=0 ;
i<3 ;
i++) {
2538 edm::LogError(
"TopInfo") <<
"WARNING: base= "<<base[
i]<<
", "<<lin.
pedestal_[
i]<<
" for gainId[0-2]="<<
i<<
" ==> forcing at 0"<<
"\n" ;
2549 gctphi = (ttphi+1)/4;
2550 if(ttphi<=2) gctphi=0;
2551 if(ttphi>=71) gctphi=0;
2557 if(tteta>0) gcteta = (tteta-1)/4 + 11;
2558 else if(tteta<0) gcteta = (tteta+1)/4 + 10;
2563 std::stringstream sdet ;
2565 if (tcc>36 && tcc<55) sdet<<
"EB-"<<tcc-36 ;
2566 else if (tcc>=55 && tcc<73) sdet<<
"EB+"<<tcc-54 ;
2567 else if (tcc<=36) sdet<<
"EE-" ;
2570 if (tcc<=36 || tcc>=73) {
2571 if (tcc>=73) tcc-=72 ;
2572 if (tcc==1 || tcc==18 || tcc==19 || tcc==36) sdet<<7 ;
2573 else if (tcc==2 || tcc==3 || tcc==20 || tcc==21) sdet<<8 ;
2574 else if (tcc==4 || tcc==5 || tcc==22 || tcc==23) sdet<<9 ;
2575 else if (tcc==6 || tcc==7 || tcc==24 || tcc==25) sdet<<1 ;
2576 else if (tcc==8 || tcc==9 || tcc==26 || tcc==27) sdet<<2 ;
2577 else if (tcc==10 || tcc==11 || tcc==28 || tcc==29) sdet<<3 ;
2578 else if (tcc==12 || tcc==13 || tcc==30 || tcc==31) sdet<<4 ;
2579 else if (tcc==14 || tcc==15 || tcc==32 || tcc==33) sdet<<5 ;
2580 else if (tcc==16 || tcc==17 || tcc==34 || tcc==35) sdet<<6 ;
2587 std::stringstream crate ;
2592 if (tcc>=40 && tcc<=42) {crate<<
"02d" ; slot = 5 + (tcc-40)*6 ;}
2593 if (tcc>=43 && tcc<=45) {crate<<
"03d" ; slot = 5 + (tcc-43)*6 ;}
2594 if (tcc>=37 && tcc<=39) {crate<<
"04d" ; slot = 5 + (tcc-37)*6 ;}
2595 if (tcc>=52 && tcc<=54) {crate<<
"06d" ; slot = 5 + (tcc-52)*6 ;}
2596 if (tcc>=46 && tcc<=48) {crate<<
"07d" ; slot = 5 + (tcc-46)*6 ;}
2597 if (tcc>=49 && tcc<=51) {crate<<
"08d" ; slot = 5 + (tcc-49)*6 ;}
2598 if (tcc>=58 && tcc<=60) {crate<<
"02h" ; slot = 5 + (tcc-58)*6 ;}
2599 if (tcc>=61 && tcc<=63) {crate<<
"03h" ; slot = 5 + (tcc-61)*6 ;}
2600 if (tcc>=55 && tcc<=57) {crate<<
"04h" ; slot = 5 + (tcc-55)*6 ;}
2601 if (tcc>=70 && tcc<=72) {crate<<
"06h" ; slot = 5 + (tcc-70)*6 ;}
2602 if (tcc>=64 && tcc<=66) {crate<<
"07h" ; slot = 5 + (tcc-64)*6 ;}
2603 if (tcc>=67 && tcc<=69) {crate<<
"08h" ; slot = 5 + (tcc-67)*6 ;}
2605 if (tcc>=76 && tcc<=81) {
2607 if (tcc%2==0) slot = 2 + (tcc-76)*3 ;
2608 else slot = 4 + (tcc-77)*3 ;
2610 if (tcc>=94 && tcc<=99) {
2612 if (tcc%2==0) slot = 3 + (tcc-94)*3 ;
2613 else slot = 5 + (tcc-95)*3 ;
2616 if (tcc>=22 && tcc<=27) {
2618 if (tcc%2==0) slot = 2 + (tcc-22)*3 ;
2619 else slot = 4 + (tcc-23)*3 ;
2621 if (tcc>=4 && tcc<=9) {
2623 if (tcc%2==0) slot = 3 + (tcc-4)*3 ;
2624 else slot = 5 + (tcc-5)*3 ;
2627 if (tcc>=82 && tcc<=87) {
2629 if (tcc%2==0) slot = 2 + (tcc-82)*3 ;
2630 else slot = 4 + (tcc-83)*3 ;
2632 if (tcc>=100 && tcc<=105) {
2634 if (tcc%2==0) slot = 3 + (tcc-100)*3 ;
2635 else slot = 5 + (tcc-101)*3 ;
2638 if (tcc>=28 && tcc<=33) {
2640 if (tcc%2==0) slot = 2 + (tcc-28)*3 ;
2641 else slot = 4 + (tcc-29)*3 ;
2643 if (tcc>=10 && tcc<=15) {
2645 if (tcc%2==0) slot = 3 + (tcc-10)*3 ;
2646 else slot = 5 + (tcc-11)*3 ;
2649 if (tcc==34) {crate<<
"04l" ; slot = 2 ;}
2650 if (tcc==16) {crate<<
"04l" ; slot = 3 ;}
2651 if (tcc==35) {crate<<
"04l" ; slot = 4 ;}
2652 if (tcc==17) {crate<<
"04l" ; slot = 5 ;}
2653 if (tcc==36) {crate<<
"04l" ; slot = 8 ;}
2654 if (tcc==18) {crate<<
"04l" ; slot = 9 ;}
2655 if (tcc==19) {crate<<
"04l" ; slot = 10 ;}
2656 if (tcc==1) {crate<<
"04l" ; slot = 11 ;}
2657 if (tcc==20) {crate<<
"04l" ; slot = 14 ;}
2658 if (tcc==2) {crate<<
"04l" ; slot = 15 ;}
2659 if (tcc==21) {crate<<
"04l" ; slot = 16 ;}
2660 if (tcc==3) {crate<<
"04l" ; slot = 17 ;}
2662 if (tcc==88) {crate<<
"06l" ; slot = 2 ;}
2663 if (tcc==106) {crate<<
"06l" ; slot = 3 ;}
2664 if (tcc==89) {crate<<
"06l" ; slot = 4 ;}
2665 if (tcc==107) {crate<<
"06l" ; slot = 5 ;}
2666 if (tcc==90) {crate<<
"06l" ; slot = 8 ;}
2667 if (tcc==108) {crate<<
"06l" ; slot = 9 ;}
2668 if (tcc==73) {crate<<
"06l" ; slot = 10 ;}
2669 if (tcc==91) {crate<<
"06l" ; slot = 11 ;}
2670 if (tcc==74) {crate<<
"06l" ; slot = 14 ;}
2671 if (tcc==92) {crate<<
"06l" ; slot = 15 ;}
2672 if (tcc==75) {crate<<
"06l" ; slot = 16 ;}
2673 if (tcc==93) {crate<<
"06l" ; slot = 17 ;}
2675 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 [...
virtual const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
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)
Geom::Phi< T > phi() const
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)
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
Geom::Theta< T > theta() const
uint32_t rawId() const
get the raw id
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
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 setLUTValue(int i, int x)
virtual void analyze(const edm::Event &evt, const edm::EventSetup &evtSetup)
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 subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
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)
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
return(e1-e2)*(e1-e2)+dp *dp
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)
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)