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";
332 (*out_file_ )<<
"EOF"<<std::endl ;
353 int etaSlice = (towerInTCC-1)/4+1 ;
355 if (tccId>36 || tccId<73)
return etaSlice ;
358 if (tccId >=1 && tccId <= 18) etaSlice += 21 ;
359 if (tccId >=19 && tccId <= 36) etaSlice += 17 ;
360 if (tccId >=91 && tccId <= 108) etaSlice += 21 ;
361 if (tccId >=73 && tccId <= 90) etaSlice += 17 ;
387 std::ostringstream ss;
388 ss <<
"EcalLaserDbAnalyzer::analyze\n";
391 ss <<
"EcalLaserDbAnalyzer::analyze-> got EcalLaserDbRecord: \n";
399 for(italpha = laserAlphaMap.
barrelItems().begin(); italpha != laserAlphaMap.
barrelItems().end(); ++italpha) {
400 if (cnt %1000 == 0) {
402 ss <<
" Barrel ALPHA = " << (*italpha) <<
" cmsswId " << ebdetid.
rawId() <<
"\n";
406 ss <<
"Number of barrel Alpha parameters : " << cnt <<
"\n";
409 for(italpha = laserAlphaMap.
endcapItems().begin(); italpha != laserAlphaMap.
endcapItems().end(); ++italpha) {
410 if (cnt %1000 == 0) {
412 ss <<
"EndCap ALPHA = " << (*italpha) <<
" cmsswId " << eedetid.
rawId() <<
"\n";
416 ss <<
"Number of Endcap Alpha parameters : " << cnt <<
"\n";
425 edm::LogInfo(
"TopInfo") <<
"INFO: READING transparency correction files" <<
"\n";
426 ss <<
"INFO: READING transparency correction files\n";
431 transparency.getline(buf,
sizeof(buf),
'\n');
433 while( transparency ) {
434 std::stringstream
sin(buf);
439 double xtal_trans_corr;
440 sin >> xtal_trans_corr;
443 ss << raw_xtal_id <<
" " << xtal_trans_corr <<
"\n";
448 transparency.getline(buf,
sizeof(buf),
'\n');
450 transparency.close();
451 ss <<
"INFO: DONE transparency correction files " << xtalcounter <<
"\n";
456 edm::LogInfo(
"TopInfo") <<
"INFO: READING transparency correction tag" <<
"\n";
465 for(
int ib = 0;
ib < 61200;
ib++) {
472 for(
int ie = 0; ie < 14648; ie++) {
478 ss <<
"INFO: DONE transparency correction tag\n";
485 TFile saving (
"EcalTPGParam.root",
"recreate") ;
487 TH2F * ICEB =
new TH2F(
"ICEB",
"IC: Barrel", 360, 1, 361, 172, -86, 86) ;
488 ICEB->GetYaxis()->SetTitle(
"eta index") ;
489 ICEB->GetXaxis()->SetTitle(
"phi index") ;
490 TH2F * tpgFactorEB =
new TH2F(
"tpgFactorEB",
"tpgFactor: Barrel", 360, 1, 361, 172, -86, 86) ;
491 tpgFactorEB->GetYaxis()->SetTitle(
"eta index") ;
492 tpgFactorEB->GetXaxis()->SetTitle(
"phi index") ;
494 TH2F * ICEEPlus =
new TH2F(
"ICEEPlus",
"IC: Plus Endcap", 120, -9, 111, 120, -9, 111) ;
495 ICEEPlus->GetYaxis()->SetTitle(
"y index") ;
496 ICEEPlus->GetXaxis()->SetTitle(
"x index") ;
497 TH2F * tpgFactorEEPlus =
new TH2F(
"tpgFactorEEPlus",
"tpgFactor: Plus Endcap", 120, -9, 111, 120, -9, 111) ;
498 tpgFactorEEPlus->GetYaxis()->SetTitle(
"y index") ;
499 tpgFactorEEPlus->GetXaxis()->SetTitle(
"x index") ;
500 TH2F * ICEEMinus =
new TH2F(
"ICEEMinus",
"IC: Minus Endcap", 120, -9, 111, 120, -9, 111) ;
501 ICEEMinus->GetYaxis()->SetTitle(
"y index") ;
502 ICEEMinus->GetXaxis()->SetTitle(
"x index") ;
503 TH2F * tpgFactorEEMinus =
new TH2F(
"tpgFactorEEMinus",
"tpgFactor: Minus Endcap", 120, -9, 111, 120, -9, 111) ;
504 tpgFactorEEMinus->GetYaxis()->SetTitle(
"y index") ;
505 tpgFactorEEMinus->GetXaxis()->SetTitle(
"x index") ;
507 TH2F * IC =
new TH2F(
"IC",
"IC", 720, -acos(-1.), acos(-1.), 600, -3., 3.) ;
508 IC->GetYaxis()->SetTitle(
"eta") ;
509 IC->GetXaxis()->SetTitle(
"phi") ;
510 TH2F * tpgFactor =
new TH2F(
"tpgFactor",
"tpgFactor", 720, -acos(-1.), acos(-1.), 600, -3., 3.) ;
511 tpgFactor->GetYaxis()->SetTitle(
"eta") ;
512 tpgFactor->GetXaxis()->SetTitle(
"phi") ;
514 TH1F * hshapeEB =
new TH1F(
"shapeEB",
"shapeEB", 250, 0., 10.) ;
515 TH1F * hshapeEE =
new TH1F(
"shapeEE",
"shapeEE", 250, 0., 10.) ;
517 TTree *
ntuple =
new TTree(
"tpgmap",
"TPG geometry map") ;
518 const std::string branchFloat[26] = {
"fed",
"tcc",
"tower",
"stripInTower",
"xtalInStrip",
519 "CCU",
"VFE",
"xtalInVFE",
"xtalInCCU",
"ieta",
"iphi",
520 "ix",
"iy",
"iz",
"hashedId",
"ic",
"cmsswId",
"dbId",
"ietaTT",
"iphiTT",
521 "TCCch",
"TCCslot",
"SLBch",
"SLBslot",
"ietaGCT",
"iphiGCT"} ;
523 for (
int i=0 ;
i<26 ;
i++) ntuple->Branch(branchFloat[
i].c_str(),&
ntupleInts_[
i],(branchFloat[
i]+
string(
"/I")).c_str()) ;
528 TNtuple *ntupleSpike =
new TNtuple(
"spikeParam",
"Spike parameters",
"gainId:theta:G:g:ped:pedLin") ;
536 list<uint32_t> towerListEB ;
537 list<uint32_t> stripListEB ;
538 list<uint32_t> towerListEE ;
539 list<uint32_t> stripListEE ;
540 list<uint32_t>::iterator itList ;
542 map<int, uint32_t> stripMapEB ;
543 map<uint32_t, uint32_t> stripMapEBsintheta ;
551 ss <<
"Getting the pedestals from offline DB...\n";
560 for (pedIter = pedMap.
begin() ; pedIter != pedMap.
end() && nPed<10 ; ++pedIter, nPed++) {
565 ss <<
"Getting the pedestals from previous configuration\n";
571 ss <<
"trying to read previous tag if it exists tag="<<
tag_<<
".version"<<
version_<<
"\n";
572 db_-> fetchConfigSet(&fe_main_info);
577 db_-> fetchConfigSet(&fe_ped_info);
578 std::map<EcalLogicID, FEConfigPedDat> dataset_TpgPed;
581 typedef std::map<EcalLogicID, FEConfigPedDat>::const_iterator CIfeped;
585 for (CIfeped
p = dataset_TpgPed.begin();
p != dataset_TpgPed.end();
p++)
593 if (ecid_name==
"EB_crystal_number") {
596 int sm_num=ecid_xt.
getID1();
597 int xt_num=ecid_xt.
getID2();
608 if(icells<10) ss <<
" copy the EB data " <<
" ped = " << item.
mean_x12<<
"\n";
613 }
else if (ecid_name==
"EE_crystal_number"){
637 for (pedIter = pedMap.
begin() ; pedIter != pedMap.
end() && nPed<10 ; ++pedIter, nPed++) {
647 ss <<
"Getting the pedestals from configuration number"<<
m_write_ped <<
"\n";
656 fe_ped_info.
setId(m_write_ped);
657 db_-> fetchConfigSet(&fe_ped_info);
658 std::map<EcalLogicID, FEConfigPedDat> dataset_TpgPed;
661 typedef std::map<EcalLogicID, FEConfigPedDat>::const_iterator CIfeped;
665 for (CIfeped
p = dataset_TpgPed.begin();
p != dataset_TpgPed.end();
p++)
673 if (ecid_name==
"EB_crystal_number") {
674 if(icells<10)
edm::LogInfo(
"TopInfo") <<
" copy the EB data " <<
" icells = " << icells <<
"\n";
675 int sm_num=ecid_xt.
getID1();
676 int xt_num=ecid_xt.
getID2();
689 }
else if (ecid_name==
"EE_crystal_number"){
713 for (pedIter = pedMap.
begin() ; pedIter != pedMap.
end() && nPed<10 ; ++pedIter, nPed++) {
723 ss <<
"Getting intercalib from offline DB...\n";
730 for (calIter = calibMap.
begin() ; calIter != calibMap.
end() && nCal<10 ; ++calIter, nCal++) {
731 ss << (*calIter)<<
"\n" ;
735 float calibvec[1700] ;
737 edm::LogInfo(
"TopInfo") <<
"H2: overwriting IC coef with file"<<
"\n" ;
742 if (calibfile.is_open()) {
743 calibfile >> strdata >> strdata >> strdata >> strdata >> strdata ;
744 while(!calibfile.eof()) {
745 calibfile >> idata >> icry >> fcali >> fdata >> fdata ;
746 calibvec[icry-1] = fcali ;
755 ss <<
"Getting the gain ratios from offline DB...\n";
761 for (gainIter = gainMap.
begin() ; gainIter != gainMap.
end() && nGain<10 ; ++gainIter, nGain++) {
769 ss <<
"Getting the ADC to GeV from offline DB...\n";
778 vector<EcalLogicID> my_EcalLogicId;
779 vector<EcalLogicID> my_TTEcalLogicId;
780 vector<EcalLogicID> my_StripEcalLogicId;
784 vector<EcalLogicID> my_TTEcalLogicId_EE;
785 vector<EcalLogicID> my_RTEcalLogicId_EE;
786 vector<EcalLogicID> my_StripEcalLogicId1_EE;
787 vector<EcalLogicID> my_StripEcalLogicId2_EE;
788 vector<EcalLogicID> my_CrystalEcalLogicId_EE;
789 vector<EcalLogicID> my_TTEcalLogicId_EB_by_TCC;
790 vector<EcalLogicID> my_StripEcalLogicId_EE_strips_by_TCC;
798 "EB_crystal_number",12 );
803 "EB_trigger_tower",12 );
805 ss <<
"got the 3 ecal barrel logic id set\n";
812 "EE_crystal_number",123 );
820 "ECAL_readout_strip",123 );
827 "ECAL_readout_strip",123 );
835 "EE_trigger_strip",123 );
845 "ECAL_trigger_tower",12 );
853 "EE_trigger_tower",12 );
861 "EE_readout_tower",12 );
866 ss <<
"Getting the latest ids for this tag (latest version) "<<
"\n";
871 ss <<
"trying to read previous tag if it exists tag="<<
tag_<<
".version"<<
version_<<
"\n";
873 db_-> fetchConfigSet(&fe_main_info);
894 map<EcalLogicID, FEConfigPedDat> pedset ;
895 map<EcalLogicID, FEConfigLinDat> linset ;
896 map<EcalLogicID, FEConfigLinParamDat> linparamset ;
897 map<EcalLogicID, FEConfigLUTParamDat> lutparamset ;
898 map<EcalLogicID, FEConfigFgrParamDat> fgrparamset ;
900 map<int, linStruc> linEtaSlice ;
901 map< vector<int>,
linStruc > linMap ;
904 int NbOfStripPerTCC[108][68] ;
905 for (
int i=0 ;
i<108 ;
i++)
906 for (
int j=0 ; j<68 ; j++)
907 NbOfStripPerTCC[
i][j] = 0 ;
910 for (vector<DetId>::const_iterator it = ebCells.begin(); it != ebCells.end(); ++it) {
917 if (stripInTower>NbOfStripPerTCC[tccNb-1][towerInTCC-1]) NbOfStripPerTCC[tccNb-1][towerInTCC-1] = stripInTower ;
919 for (vector<DetId>::const_iterator it = eeCells.begin(); it != eeCells.end(); ++it) {
926 if (stripInTower>NbOfStripPerTCC[tccNb-1][towerInTCC-1]) NbOfStripPerTCC[tccNb-1][towerInTCC-1] = stripInTower ;
932 if (
writeToFiles_) (*out_file_)<<
"COMMENT ====== barrel crystals ====== "<<std::endl ;
935 for (vector<DetId>::const_iterator it = ebCells.begin(); it != ebCells.end(); ++it) {
949 int xtalInVFE = Id.
xtalId() ;
950 int xtalWithinCCUid = 5*(VFEid-1) + xtalInVFE -1 ;
952 (*geomFile_)<<
"dccNb = "<<dccNb<<
" tccNb = "<<tccNb<<
" towerInTCC = "<<towerInTCC
953 <<
" stripInTower = "<<stripInTower<<
" xtalInStrip = "<<xtalInStrip
954 <<
" CCUid = "<<CCUid<<
" VFEid = "<<VFEid<<
" xtalInVFE = "<<xtalInVFE
955 <<
" xtalWithinCCUid = "<<xtalWithinCCUid<<
" ieta = "<<
id.ieta()<<
" iphi = "<<
id.iphi()
956 <<
" xtalhashedId = "<<
id.hashedIndex()<<
" xtalNb = "<<
id.ic()
957 <<
" ietaTT = "<<towid.
ieta()<<
" iphiTT = "<<towid.
iphi()<<endl ;
959 int TCCch = towerInTCC ;
960 int SLBslot =
int((towerInTCC-1)/8.) + 1 ;
961 int SLBch = (towerInTCC-1)%8 + 1 ;
962 int cmsswId =
id.rawId() ;
963 int ixtal=(
id.ism()-1)*1700+(
id.ic()-1);
966 int val[] = {dccNb+600,tccNb,towerInTCC,stripInTower,
967 xtalInStrip,CCUid,VFEid,xtalInVFE,xtalWithinCCUid,
id.ieta(),
id.iphi(),
969 id.ic(), cmsswId, dbId,
979 if (tccNb == 37 && stripInTower == 3 && xtalInStrip == 3 && (towerInTCC-1)%4==0) {
980 int etaSlice = towid.
ietaAbs() ;
985 getCoeff(coeff, calibMap, laserAlphaMap,
id.rawId(), str) ;
987 getCoeff(coeff, gainMap,
id.rawId()) ;
988 getCoeff(coeff, pedMap,
id.rawId()) ;
990 for (
int i=0 ;
i<3 ;
i++) {
993 if (!ok)
edm::LogError(
"TopInfo") <<
"unable to compute the parameters for SM="<<
id.ism()<<
" xt="<<
id.ic()<<
" " <<
dec<<
id.rawId()<<
"\n" ;
1003 if (!ok) ss <<
"SM="<<
id.ism()<<
" xt="<<
id.ic()<<
" " <<
dec<<
id.rawId()<<
"\n" ;
1004 linEtaSlice[etaSlice] = lin ;
1009 for (vector<DetId>::const_iterator it = ebCells.begin(); it != ebCells.end(); ++it) {
1014 towerListEB.push_back(towid.
rawId()) ;
1016 stripListEB.push_back(elId.
rawId() & 0xfffffff8) ;
1025 int xtalInVFE = Id.
xtalId() ;
1026 int xtalWithinCCUid = 5*(VFEid-1) + xtalInVFE -1 ;
1027 int etaSlice = towid.
ietaAbs() ;
1030 int hashedStripLogicID = 68*5*(
id.ism()-1) + 5*(towerInTCC-1) + (VFEid-1) ;
1031 stripMapEB[hashedStripLogicID] = elId.
rawId() & 0xfffffff8 ;
1055 getCoeff(coeff, calibMap, laserAlphaMap,
id.rawId(), str) ;
1059 getCoeff(coeff, gainMap,
id.rawId()) ;
1060 getCoeff(coeff, pedMap,
id.rawId()) ;
1061 ICEB->Fill(
id.iphi(),
id.ieta(), coeff.
calibCoeff_) ;
1064 vector<int> xtalCCU ;
1065 xtalCCU.push_back(dccNb+600) ;
1066 xtalCCU.push_back(CCUid) ;
1067 xtalCCU.push_back(xtalWithinCCUid) ;
1068 xtalCCU.push_back(
id.rawId()) ;
1073 map<int, linStruc>::const_iterator itLin = linEtaSlice.find(etaSlice);
1074 if (itLin != linEtaSlice.end()) {
1075 linMap[xtalCCU] = itLin->second ;
1077 for (
int i=0 ;
i<3 ;
i++)
1078 (*
out_file_) << hex <<
" 0x"<<itLin->second.pedestal_[
i]<<
" 0x"<<itLin->second.mult_[
i]<<
" 0x"<<itLin->second.shift_[
i]<<std::endl;
1081 for (
int i=0 ;
i<3 ;
i++) {
1088 tpgFactorEB->Fill(
id.iphi(),
id.ieta(), factor) ;
1092 else ss <<
"current EtaSlice = "<<etaSlice<<
" not found in the EtaSlice map"<<
"\n" ;
1097 int forceBase12 = 0 ;
1098 for (
int i=0 ;
i<3 ;
i++) {
1101 if (!ok)
edm::LogError(
"TopInfo") <<
"unable to compute the parameters for SM="<<
id.ism()<<
" xt="<<
id.ic()<<
" " <<
dec<<
id.rawId()<<
"\n" ;
1113 double G = mult*
pow(2.0,-(shift+2)) ;
1114 double g = G/
sin(theta) ;
1116 base = double(coeff.
pedestals_[
i]) - pedestal_offset_/
g ;
1117 if (base<0.) base = 0 ;
1118 forceBase12 =
int(base) ;
1137 if (!ok) ss <<
"SM="<<
id.ism()<<
" xt="<<
id.ic()<<
" " <<
dec<<
id.rawId()<<
"\n" ;
1139 for (
int i=0 ;
i<3 ;
i++) {
1148 tpgFactorEB->Fill(
id.iphi(),
id.ieta(), factor) ;
1153 double g = G/
sin(theta) ;
1160 ntupleSpike->Fill(val) ;
1162 linMap[xtalCCU] = lin ;
1166 int ixtal=(
id.ism()-1)*1700+(
id.ic()-1);
1168 pedset[logicId] = pedDB ;
1169 linset[logicId] = linDB ;
1177 linparamset[my_EcalLogicId_EB] = linparam ;
1184 fgrparamset[my_EcalLogicId_EB] = fgrparam ;
1191 lutparamset[my_EcalLogicId_EB] = lutparam ;
1197 if (
writeToFiles_) (*out_file_)<<
"COMMENT ====== endcap crystals ====== "<<std::endl ;
1200 for (vector<DetId>::const_iterator it = eeCells.begin(); it != eeCells.end(); ++it) {
1207 int dccNb = Id.
dccId() ;
1214 int xtalInVFE = Id.
xtalId() ;
1215 int xtalWithinCCUid = 5*(VFEid-1) + xtalInVFE -1 ;
1217 (*geomFile_)<<
"dccNb = "<<dccNb<<
" tccNb = "<<tccNb<<
" towerInTCC = "<<towerInTCC
1218 <<
" stripInTower = "<<stripInTower<<
" xtalInStrip = "<<xtalInStrip
1219 <<
" CCUid = "<<CCUid<<
" VFEid = "<<VFEid<<
" xtalInVFE = "<<xtalInVFE
1220 <<
" xtalWithinCCUid = "<<xtalWithinCCUid<<
" ix = "<<
id.ix()<<
" iy = "<<
id.iy()
1221 <<
" xtalhashedId = "<<
id.hashedIndex()<<
" xtalNb = "<<
id.isc()
1222 <<
" ietaTT = "<<towid.
ieta()<<
" iphiTT = "<<towid.
iphi()<<endl ;
1224 int TCCch = stripInTower ;
1225 int SLBslot, SLBch ;
1228 SLBch = 4 + towerInTCC ;
1231 SLBslot =
int((towerInTCC-5)/8.) + 2 ;
1232 SLBch = (towerInTCC-5)%8 + 1 ;
1234 for (
int j=0 ; j<towerInTCC-1 ; j++) TCCch += NbOfStripPerTCC[tccNb-1][j] ;
1236 int cmsswId =
id.rawId() ;
1238 int iz =
id.positiveZ() ;
1239 if (iz ==0) iz = -1 ;
1240 for (
int k=0;
k<(
int)my_CrystalEcalLogicId_EE.size();
k++) {
1241 int z= my_CrystalEcalLogicId_EE[
k].getID1() ;
1242 int x= my_CrystalEcalLogicId_EE[
k].getID2() ;
1243 int y= my_CrystalEcalLogicId_EE[
k].getID3() ;
1244 if (
id.ix()==x &&
id.iy()==y && iz==z) logicId=my_CrystalEcalLogicId_EE[
k];
1248 int val[] = {dccNb+600,tccNb,towerInTCC,stripInTower,
1249 xtalInStrip,CCUid,VFEid,xtalInVFE,xtalWithinCCUid,-999,-999,
1251 id.ic(),cmsswId, dbId,
1259 if ((tccNb == 76 || tccNb == 94) && stripInTower == 1 && xtalInStrip == 3 && (towerInTCC-1)%4==0) {
1260 int etaSlice = towid.
ietaAbs() ;
1265 getCoeff(coeff, calibMap, laserAlphaMap,
id.rawId(), str) ;
1267 getCoeff(coeff, gainMap,
id.rawId()) ;
1268 getCoeff(coeff, pedMap,
id.rawId()) ;
1270 for (
int i=0 ;
i<3 ;
i++) {
1273 if (!ok)
edm::LogError(
"TopInfo") <<
"unable to compute the parameters for Quadrant="<<
id.iquadrant()<<
" xt="<<
id.ic()<<
" " <<
dec<<
id.rawId()<<
"\n" ;
1283 if (!ok) ss <<
"Quadrant="<<
id.iquadrant()<<
" xt="<<
id.ic()<<
" " <<
dec<<
id.rawId()<<
"\n" ;
1285 linEtaSlice[etaSlice] = lin ;
1290 for (vector<DetId>::const_iterator it = eeCells.begin(); it != eeCells.end(); ++it) {
1297 towerListEE.push_back(towid.
rawId()) ;
1301 towerListEE.push_back(additionalTower.rawId()) ;
1303 stripListEE.push_back(elId.
rawId() & 0xfffffff8) ;
1304 int dccNb = Id.
dccId() ;
1311 int xtalInVFE = Id.
xtalId() ;
1312 int xtalWithinCCUid = 5*(VFEid-1) + xtalInVFE -1 ;
1313 int etaSlice = towid.
ietaAbs() ;
1320 int iz =
id.positiveZ() ;
1321 if (iz ==0) iz = -1 ;
1322 for (
int k=0;
k<(
int)my_CrystalEcalLogicId_EE.size();
k++) {
1323 int z= my_CrystalEcalLogicId_EE[
k].getID1() ;
1324 int x= my_CrystalEcalLogicId_EE[
k].getID2() ;
1325 int y= my_CrystalEcalLogicId_EE[
k].getID3() ;
1326 if (
id.ix()==x &&
id.iy()==y && iz==z) logicId=my_CrystalEcalLogicId_EE[
k];
1334 getCoeff(coeff, calibMap, laserAlphaMap,
id.rawId(), str) ;
1336 getCoeff(coeff, gainMap,
id.rawId()) ;
1337 getCoeff(coeff, pedMap,
id.rawId()) ;
1339 else ICEEMinus->Fill(
id.ix(),
id.iy(), coeff.
calibCoeff_) ;
1342 vector<int> xtalCCU ;
1343 xtalCCU.push_back(dccNb+600) ;
1344 xtalCCU.push_back(CCUid) ;
1345 xtalCCU.push_back(xtalWithinCCUid) ;
1346 xtalCCU.push_back(
id.rawId()) ;
1351 map<int, linStruc>::const_iterator itLin = linEtaSlice.find(etaSlice);
1352 if (itLin != linEtaSlice.end()) {
1353 linMap[xtalCCU] = itLin->second ;
1355 for (
int i=0 ;
i<3 ;
i++)
1356 (*
out_file_) << hex <<
" 0x"<<itLin->second.pedestal_[
i]<<
" 0x"<<itLin->second.mult_[
i]<<
" 0x"<<itLin->second.shift_[
i]<<std::endl;
1359 for (
int i=0 ;
i<3 ;
i++) {
1366 if (
id.
zside()>0) tpgFactorEEPlus->Fill(
id.ix(),
id.iy(), factor) ;
1367 else tpgFactorEEMinus->Fill(
id.ix(),
id.iy(), factor) ;
1371 else ss <<
"current EtaSlice = "<<etaSlice<<
" not found in the EtaSlice map"<<
"\n";
1376 for (
int i=0 ;
i<3 ;
i++) {
1379 if (!ok)
edm::LogError(
"TopInfo") <<
"unable to compute the parameters for "<<
dec<<
id.rawId()<<
"\n" ;
1389 if (!ok) ss <<
"Quadrant="<<
id.iquadrant()<<
" xt="<<
id.ic()<<
" " <<
dec<<
id.rawId()<<
"\n" ;
1391 for (
int i=0 ;
i<3 ;
i++) {
1400 if (
id.
zside()>0) tpgFactorEEPlus->Fill(
id.ix(),
id.iy(), factor) ;
1401 else tpgFactorEEMinus->Fill(
id.ix(),
id.iy(), factor) ;
1406 linMap[xtalCCU] = lin ;
1409 pedset[logicId] = pedDB ;
1410 linset[logicId] = linDB ;
1420 linparamset[my_EcalLogicId_EE] = linparam ;
1426 lutparamset[my_EcalLogicId_EE] = lutparam ;
1432 fgrparamset[my_EcalLogicId_EE] = fgrparam ;
1441 ss <<
" LIN tag "<<lin_tag<<
"\n";
1446 ss <<
"the ped id ="<<
ped_conf_id_<<
" will be used for the pedestals "<<
"\n";
1456 evgueni<<
"void getLinParamTPG_hardcoded(int fed, int ccu, int xtal,"<<endl ;
1457 evgueni<<
" int & mult12, int & shift12, int & base12,"<<endl ;
1458 evgueni<<
" int & mult6, int & shift6, int & base6,"<<endl ;
1459 evgueni<<
" int & mult1, int & shift1, int & base1)"<<endl ;
1461 evgueni<<
" mult12 = 0 ; shift12 = 0 ; base12 = 0 ; mult6 = 0 ; shift6 = 0 ; base6 = 0 ; mult1 = 0 ; shift1 = 0 ; base1 = 0 ;"<<endl ;
1462 map< vector<int>,
linStruc>::const_iterator itLinMap ;
1463 for (itLinMap = linMap.begin() ; itLinMap != linMap.end() ; itLinMap++) {
1464 vector<int> xtalInCCU = itLinMap->first ;
1465 evgueni<<
" if (fed=="<<xtalInCCU[0]<<
" && ccu=="<<xtalInCCU[1]<<
" && xtal=="<<xtalInCCU[2]<<
") {" ;
1466 evgueni<<
" mult12 = "<<itLinMap->second.
mult_[0]<<
" ; shift12 = "<<itLinMap->second.shift_[0]<<
" ; base12 = "<<itLinMap->second.pedestal_[0]<<
" ; " ;
1467 evgueni<<
" mult6 = "<<itLinMap->second.mult_[1]<<
" ; shift6 = "<<itLinMap->second.shift_[1]<<
" ; base6 = "<<itLinMap->second.pedestal_[1]<<
" ; " ;
1468 evgueni<<
" mult1 = "<<itLinMap->second.mult_[2]<<
" ; shift1 = "<<itLinMap->second.shift_[2]<<
" ; base1 = "<<itLinMap->second.pedestal_[2]<<
" ; " ;
1469 evgueni<<
" return ;}" <<endl ;
1471 evgueni<<
"}" <<endl ;
1480 const int NWEIGROUPS = 2 ;
1481 std::vector<unsigned int>
weights[NWEIGROUPS] ;
1489 map<EcalLogicID, FEConfigWeightGroupDat>
dataset;
1491 for (
int igrp=0 ; igrp<NWEIGROUPS ; igrp++) {
1493 if (weights[igrp].
size() == 5) {
1496 (*out_file_) <<std::endl ;
1497 (*out_file_) <<
"WEIGHT "<<igrp<<endl ;
1499 (*out_file_)<<std::endl ;
1500 (*out_file_) <<std::endl ;
1503 ss <<
"going to write the weights for groupe:"<<igrp<<
"\n";
1514 dataset[ecid] = gut;
1522 map<EcalLogicID, FEConfigWeightDat> dataset2;
1525 for (
int ich=0; ich<(
int)my_StripEcalLogicId.size() ; ich++){
1529 dataset2[my_StripEcalLogicId[ich]] = wut;
1533 for (
int ich=0; ich<(
int)my_StripEcalLogicId1_EE.size() ; ich++){
1538 dataset2[my_StripEcalLogicId1_EE[ich]] = wut;
1541 for (
int ich=0; ich<(
int)my_StripEcalLogicId2_EE.size() ; ich++){
1546 dataset2[my_StripEcalLogicId2_EE[ich]] = wut;
1551 wtag.str(
""); wtag<<
"Shape_NGroups_"<<NWEIGROUPS;
1553 ss <<
" weight tag "<<weight_tag<<
"\n";
1564 unsigned int lowRatio, highRatio, lowThreshold, highThreshold, lutFG ;
1567 (*out_file_) <<std::endl ;
1568 (*out_file_) <<
"FG 0"<<std::endl ;
1569 (*out_file_)<<hex<<
"0x"<<lowThreshold<<
" 0x"<<highThreshold
1570 <<
" 0x"<<lowRatio<<
" 0x"<<highRatio<<
" 0x"<<lutFG
1576 unsigned int lut_strip;
1583 ss <<
"going to write the fgr "<<
"\n";
1584 map<EcalLogicID, FEConfigFgrGroupDat>
dataset;
1587 for (
int ich=0; ich<NFGRGROUPS; ich++){
1597 dataset[ecid] = gut;
1601 map<EcalLogicID, FEConfigFgrDat> dataset2;
1603 for (
int ich=0; ich<(
int)my_TTEcalLogicId.size() ; ich++){
1610 dataset2[my_TTEcalLogicId[ich]] = wut;
1614 for (
int ich=0; ich<(
int)my_RTEcalLogicId_EE.size() ; ich++){
1622 dataset2[my_RTEcalLogicId_EE[ich]] = wut;
1626 map<EcalLogicID, FEConfigFgrEETowerDat> dataset3;
1627 for (
int ich=0; ich<(
int)my_TTEcalLogicId_EE.size() ; ich++){
1630 dataset3[my_TTEcalLogicId_EE[ich]]=fgreett;
1635 map<EcalLogicID, FEConfigFgrEEStripDat> dataset4;
1636 for (
int ich=0; ich<(
int)my_StripEcalLogicId1_EE.size() ; ich++){
1640 dataset4[my_StripEcalLogicId1_EE[ich]] = zut;
1642 for (
int ich=0; ich<(
int)my_StripEcalLogicId2_EE.size() ; ich++){
1647 dataset4[my_StripEcalLogicId2_EE[ich]] = zut;
1649 for (
int ich=0; ich<(
int)my_StripEcalLogicId.size() ; ich++){
1653 uint32_t elStripId = stripMapEB[ich] ;
1654 map<uint32_t, uint32_t>::const_iterator it = stripMapEBsintheta.find(elStripId) ;
1655 if (it != stripMapEBsintheta.end()) zut.
setThreshold(it->second);
1657 edm::LogError(
"TopInfo") <<
"ERROR: strip SFGVB threshold parameter not found for that strip:"<<thestrip.
getID1()<<
" "<<thestrip.
getID3()<<
" "<<thestrip.
getID3()<<
"\n" ;
1663 dataset4[thestrip] = zut;
1670 ss <<
" weight tag "<<weight_tag<<
"\n";
1674 map<EcalLogicID, FEConfigSpikeDat> datasetspike;
1675 for (
int ich=0; ich<(
int)my_TTEcalLogicId.size() ; ich++){
1678 datasetspike[my_TTEcalLogicId[ich]] = spiketh;
1685 ss <<
" spike tag "<<spike_tag<<
"\n";
1690 map<EcalLogicID, FEConfigTimingDat> datasetdelay;
1691 for (
int ich=0; ich<(
int)my_TTEcalLogicId_EB_by_TCC.size() ; ich++){
1694 EcalLogicID logiciddelay = my_TTEcalLogicId_EB_by_TCC[ich] ;
1695 int id1_tcc=my_TTEcalLogicId_EB_by_TCC[ich].
getID1();
1696 int id2_tt =my_TTEcalLogicId_EB_by_TCC[ich].getID2();
1697 std::map<int, vector<int> >::const_iterator ittEB =
delays_EB_.find(id1_tcc);
1698 std::vector<int> TimingDelaysEB = ittEB->second;
1701 if(TimingDelaysEB[id2_tt-1] == -1){
1702 edm::LogError(
"TopInfo") <<
"ERROR: Barrel timing delay not specified, check file, putting default value 1" <<
"\n";
1707 edm::LogError(
"TopInfo") <<
"ERROR:Barrel Could not find delay parameter for that trigger tower " <<
"\n";
1708 edm::LogError(
"TopInfo") <<
"Using default value = 1" <<
"\n";
1712 std::map<int, vector<int> >::const_iterator ittpEB =
phases_EB_.find(id1_tcc);
1713 std::vector<int> TimingPhasesEB = ittpEB->second;
1716 if(TimingPhasesEB[id2_tt-1] == -1){
1717 edm::LogError(
"TopInfo") <<
"ERROR: Barrel timing phase not specified, check file, putting default value 0" <<
"\n";
1722 edm::LogError(
"TopInfo") <<
"ERROR:Barrel Could not find phase parameter for that trigger tower " <<
"\n";
1723 edm::LogError(
"TopInfo") <<
"Using default value = 0" <<
"\n";
1727 ss << ich <<
" tcc=" << id1_tcc <<
" TT=" << id2_tt <<
" logicId=" << logiciddelay.
getLogicID()
1728 <<
" delay=" << TimingDelaysEB[id2_tt-1] <<
" phase=" << TimingPhasesEB[id2_tt-1] <<
"\n";
1732 datasetdelay[my_TTEcalLogicId_EB_by_TCC[ich]] = delay;
1738 for (
int ich=0; ich<(
int)my_StripEcalLogicId_EE_strips_by_TCC.size() ; ich++){
1744 EcalLogicID logiciddelay = my_StripEcalLogicId_EE_strips_by_TCC[ich] ;
1745 int id1_tcc=my_StripEcalLogicId_EE_strips_by_TCC[ich].
getID1();
1746 int id2_tt =my_StripEcalLogicId_EE_strips_by_TCC[ich].getID2();
1747 int id3_st =my_StripEcalLogicId_EE_strips_by_TCC[ich].getID3();
1750 if(id1_tcc != tccin) {tccin = id1_tcc; stripindex=0;}
1752 std::map<int, vector<int> >::const_iterator ittEE =
delays_EE_.find(id1_tcc);
1753 std::vector<int> TimingDelaysEE = ittEE->second;
1756 if(TimingDelaysEE[stripindex] == -1){
1757 edm::LogError(
"TopInfo") <<
"ERROR: Endcap timing delay not specified, check file, putting default value 1" <<
"\n";
1762 edm::LogError(
"TopInfo") <<
"ERROR:Endcap Could not find delay parameter for that trigger tower " <<
"\n";
1763 edm::LogError(
"TopInfo") <<
"Using default value = 1" <<
"\n";
1767 std::map<int, vector<int> >::const_iterator ittpEE =
phases_EE_.find(id1_tcc);
1768 std::vector<int> TimingPhasesEE = ittpEE->second;
1771 if(TimingPhasesEE[stripindex] == -1){
1772 edm::LogError(
"TopInfo") <<
"ERROR: Endcap timing phase not specified, check file, putting default value 0" <<
"\n";
1777 edm::LogError(
"TopInfo") <<
"ERROR:Endcap Could not find phase parameter for that trigger tower " <<
"\n";
1778 edm::LogError(
"TopInfo") <<
"Using default value = 0" <<
"\n";
1782 ss << ich <<
" stripindex=" << stripindex <<
" tcc=" << id1_tcc <<
" TT=" << id2_tt <<
" id3_st=" << id3_st
1784 <<
" delay=" << TimingDelaysEE[stripindex] <<
" phase=" << TimingPhasesEE[stripindex] <<
"\n";
1789 datasetdelay[my_StripEcalLogicId_EE_strips_by_TCC[ich]] = delay;
1793 ostringstream de_tag;
1794 de_tag.str(
""); de_tag<<
"DelaysFromFile";
1796 ss <<
" delay tag "<<delay_tag<<
"\n";
1803 ss <<
"going to write the sliding "<<
"\n";
1804 map<EcalLogicID, FEConfigSlidingDat>
dataset;
1806 for (
int ich=0; ich<(
int)my_StripEcalLogicId.size() ; ich++){
1812 dataset[my_StripEcalLogicId[ich]] = wut;
1816 for (
int ich=0; ich<(
int)my_StripEcalLogicId1_EE.size() ; ich++){
1822 dataset[my_StripEcalLogicId1_EE[ich]] = wut;
1824 for (
int ich=0; ich<(
int)my_StripEcalLogicId2_EE.size() ; ich++){
1830 dataset[my_StripEcalLogicId2_EE[ich]] = wut;
1836 wtag.str(
""); wtag<<
"Sliding_"<<
sliding_;
1838 ss <<
" sliding tag "<<justatag<<
"\n";
1851 int lut_EB[1024], lut_EE[1024] ;
1856 (*out_file_) <<std::endl ;
1857 (*out_file_) <<
"LUT 0"<<std::endl ;
1858 for (
int i=0 ;
i<1024 ;
i++) (*
out_file_)<<
"0x"<<hex<<lut_EB[
i]<<endl ;
1859 (*out_file_)<<endl ;
1865 bool newLUT(
false) ;
1866 for (
int i=0 ;
i<1024 ;
i++)
if (lut_EE[
i] != lut_EB[
i]) newLUT =
true ;
1868 (*out_file_) <<std::endl ;
1869 (*out_file_) <<
"LUT 1"<<std::endl ;
1870 for (
int i=0 ; i<1024 ; i++) (*
out_file_)<<
"0x"<<hex<<lut_EE[
i]<<endl ;
1871 (*out_file_)<<endl ;
1880 map<EcalLogicID, FEConfigLUTGroupDat>
dataset;
1886 for (
int i=0; i<1024; i++){
1891 dataset[ecid] =
lut;
1897 for (
int i=0; i<1024; i++){
1902 dataset[ecide] =
lute;
1909 map<EcalLogicID, FEConfigLUTDat> dataset2;
1911 for (
int ich=0; ich<(
int)my_TTEcalLogicId.size() ; ich++){
1917 dataset2[my_TTEcalLogicId[ich]] =
lut;
1921 for (
int ich=0; ich<(
int)my_TTEcalLogicId_EE.size() ; ich++){
1927 dataset2[my_TTEcalLogicId_EE[ich]] =
lut;
1932 ltag.str(
""); ltag<<
LUT_option_<<
"_NGroups_"<<NLUTGROUPS;
1934 ss <<
" LUT tag "<<lut_tag<<
"\n";
1947 ss <<
"\n Conf ID = " << conf_id_ <<
"\n";
1956 stripListEB.sort() ;
1957 stripListEB.unique() ;
1958 ss <<
"Number of EB strips="<<
dec<<stripListEB.size()<<
"\n" ;
1960 (*out_file_) <<std::endl ;
1961 for (itList = stripListEB.begin(); itList != stripListEB.end(); itList++ ) {
1962 (*out_file_) <<
"STRIP_EB "<<
dec<<(*itList)<<endl ;
1963 (*out_file_) << hex <<
"0x" <<
sliding_<<std::endl ;
1964 (*out_file_) <<
"0" <<std::endl ;
1965 (*out_file_) <<
"0x"<<stripMapEBsintheta[(*itList)] <<
" 0x" <<
SFGVB_lut_ <<std::endl ;
1970 stripListEE.sort() ;
1971 stripListEE.unique() ;
1972 ss <<
"Number of EE strips="<<
dec<<stripListEE.size()<<
"\n" ;
1974 (*out_file_) <<std::endl ;
1975 for (itList = stripListEE.begin(); itList != stripListEE.end(); itList++ ) {
1976 (*out_file_) <<
"STRIP_EE "<<
dec<<(*itList)<<endl ;
1977 (*out_file_) << hex <<
"0x" <<
sliding_<<std::endl ;
1979 (*out_file_) <<
" 1" << std::endl ;
1980 (*out_file_)<<hex<<
"0x"<<threshold<<
" 0x"<<lut_strip<<std::endl ;
1992 towerListEB.sort() ;
1993 towerListEB.unique() ;
1994 ss <<
"Number of EB towers="<<
dec<<towerListEB.size()<<
"\n" ;
1996 (*out_file_) <<std::endl ;
1997 for (itList = towerListEB.begin(); itList != towerListEB.end(); itList++ ) {
1998 (*out_file_) <<
"TOWER_EB "<<
dec<<(*itList)<<endl ;
1999 (*out_file_) <<
" 0\n 0\n" ;
2005 towerListEE.sort() ;
2006 towerListEE.unique() ;
2007 ss <<
"Number of EE towers="<<
dec<<towerListEE.size()<<
"\n" ;
2009 (*out_file_) <<std::endl ;
2010 for (itList = towerListEE.begin(); itList != towerListEE.end(); itList++ ) {
2011 (*out_file_) <<
"TOWER_EE "<<
dec<<(*itList)<<endl ;
2012 if (newLUT) (*out_file_) <<
" 1\n" ;
2014 (*out_file_)<<hex<<
"0x"<<lut_tower<<std::endl ;
2026 tpgFactorEB->Write() ;
2028 tpgFactorEEPlus->Write() ;
2029 ICEEMinus->Write() ;
2030 tpgFactorEEMinus->Write() ;
2032 tpgFactor->Write() ;
2036 ntupleSpike->Write() ;
2042 using namespace edm;
2043 using namespace std;
2053 (*out_file_)<<
"PHYSICS_EB "<<
dec<<eb.
rawId()<<std::endl ;
2058 (*out_file_) <<std::endl ;
2060 (*out_file_)<<
"PHYSICS_EE "<<
dec<<ee.
rawId()<<std::endl ;
2063 <<-1<<
" "<<-1<<std::endl ;
2064 (*out_file_) <<std::endl ;
2104 double factor = 1024 * ratio * gainRatio * calibCoeff *
sin(theta) * (1 << (
sliding_ + shiftDet + 2)) ;
2106 mult = (
int)(factor+0.5) ;
2107 for (shift = 0 ; shift<15 ; shift++) {
2108 if (mult>=128 && mult<256)
return true ;
2110 mult = (
int)(factor+0.5) ;
2112 edm::LogError(
"TopInfo") <<
"too bad we did not manage to calculate the factor for calib=" << calibCoeff <<
"\n";
2119 (*out_file_) <<
"COMMENT put your comments here"<<std::endl ;
2121 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2122 (*out_file_) <<
"COMMENT physics EB structure"<<std::endl ;
2123 (*out_file_) <<
"COMMENT"<<std::endl ;
2124 (*out_file_) <<
"COMMENT EtSaturation (GeV), ttf_threshold_Low (GeV), ttf_threshold_High (GeV)"<<std::endl ;
2125 (*out_file_) <<
"COMMENT FG_lowThreshold (GeV), FG_highThreshold (GeV), FG_lowRatio, FG_highRatio"<<std::endl ;
2127 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2128 (*out_file_) <<
"COMMENT"<<std::endl ;
2130 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2131 (*out_file_) <<
"COMMENT physics EE structure"<<std::endl ;
2132 (*out_file_) <<
"COMMENT"<<std::endl ;
2133 (*out_file_) <<
"COMMENT EtSaturation (GeV), ttf_threshold_Low (GeV), ttf_threshold_High (GeV)"<<std::endl ;
2134 (*out_file_) <<
"COMMENT FG_Threshold (GeV), dummy, dummy, dummy"<<std::endl ;
2135 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2136 (*out_file_) <<
"COMMENT"<<std::endl ;
2138 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2139 (*out_file_) <<
"COMMENT crystal structure (same for EB and EE)"<<std::endl ;
2140 (*out_file_) <<
"COMMENT"<<std::endl ;
2141 (*out_file_) <<
"COMMENT ped, mult, shift [gain12]"<<std::endl ;
2142 (*out_file_) <<
"COMMENT ped, mult, shift [gain6]"<<std::endl ;
2143 (*out_file_) <<
"COMMENT ped, mult, shift [gain1]"<<std::endl ;
2144 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2145 (*out_file_) <<
"COMMENT"<<std::endl ;
2147 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2148 (*out_file_) <<
"COMMENT strip EB structure"<<std::endl ;
2149 (*out_file_) <<
"COMMENT"<<std::endl ;
2150 (*out_file_) <<
"COMMENT sliding_window"<<std::endl ;
2151 (*out_file_) <<
"COMMENT weightGroupId"<<std::endl ;
2152 (*out_file_) <<
"COMMENT threshold_sfg lut_sfg"<<std::endl ;
2153 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2154 (*out_file_) <<
"COMMENT"<<std::endl ;
2156 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2157 (*out_file_) <<
"COMMENT strip EE structure"<<std::endl ;
2158 (*out_file_) <<
"COMMENT"<<std::endl ;
2159 (*out_file_) <<
"COMMENT sliding_window"<<std::endl ;
2160 (*out_file_) <<
"COMMENT weightGroupId"<<std::endl ;
2161 (*out_file_) <<
"COMMENT threshold_fg lut_fg"<<std::endl ;
2162 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2163 (*out_file_) <<
"COMMENT"<<std::endl ;
2165 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2166 (*out_file_) <<
"COMMENT tower EB structure"<<std::endl ;
2167 (*out_file_) <<
"COMMENT"<<std::endl ;
2168 (*out_file_) <<
"COMMENT LUTGroupId"<<std::endl ;
2169 (*out_file_) <<
"COMMENT FgGroupId"<<std::endl ;
2170 (*out_file_) <<
"COMMENT spike_killing_threshold"<<std::endl ;
2171 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2172 (*out_file_) <<
"COMMENT"<<std::endl ;
2174 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2175 (*out_file_) <<
"COMMENT tower EE structure"<<std::endl ;
2176 (*out_file_) <<
"COMMENT"<<std::endl ;
2177 (*out_file_) <<
"COMMENT LUTGroupId"<<std::endl ;
2178 (*out_file_) <<
"COMMENT tower_lut_fg"<<std::endl ;
2179 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2180 (*out_file_) <<
"COMMENT"<<std::endl ;
2182 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2183 (*out_file_) <<
"COMMENT Weight structure"<<std::endl ;
2184 (*out_file_) <<
"COMMENT"<<std::endl ;
2185 (*out_file_) <<
"COMMENT weightGroupId"<<std::endl ;
2186 (*out_file_) <<
"COMMENT w0, w1, w2, w3, w4"<<std::endl ;
2187 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2188 (*out_file_) <<
"COMMENT"<<std::endl ;
2190 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2191 (*out_file_) <<
"COMMENT lut structure"<<std::endl ;
2192 (*out_file_) <<
"COMMENT"<<std::endl ;
2193 (*out_file_) <<
"COMMENT LUTGroupId"<<std::endl ;
2194 (*out_file_) <<
"COMMENT LUT[1-1024]"<<std::endl ;
2195 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2196 (*out_file_) <<
"COMMENT"<<std::endl ;
2198 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2199 (*out_file_) <<
"COMMENT fg EB structure"<<std::endl ;
2200 (*out_file_) <<
"COMMENT"<<std::endl ;
2201 (*out_file_) <<
"COMMENT FgGroupId"<<std::endl ;
2202 (*out_file_) <<
"COMMENT el, eh, tl, th, lut_fg"<<std::endl ;
2203 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2204 (*out_file_) <<
"COMMENT"<<std::endl ;
2206 (*out_file_) <<std::endl ;
2213 unsigned int max = (
unsigned int)(
pow(2.,complement2)-1) ;
2214 if (weight>0) iweight=
int((1<<6)*weight+0.5) ;
2215 else iweight= max -
int(-weight*(1<<6)+0.5) +1 ;
2216 iweight = iweight &
max ;
2221 double weight = double(iweight)/
pow(2., 6.) ;
2223 if ( (iweight & (1<<(complement2-1))) != 0) weight = (double(iweight)-
pow(2., complement2))/
pow(2., 6.) ;
2228 std::ostringstream ss;
2229 ss <<
"Computing Weights...\n" ;
2231 double max = shape(timeMax) ;
2238 sumf += shape(time)/
max ;
2239 sumf2 += shape(time)/max * shape(time)/
max ;
2240 for (
int subtime = 0 ; subtime<25 ; subtime++) histo->Fill(
float(
sample*25. + subtime)/25., shape(time+subtime)) ;
2242 double lambda = 1./(sumf2-sumf*sumf/
nSample_) ;
2252 int * iweight =
new int[
nSample_] ;
2257 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) isumw += iweight[sample] ;
2259 isumw = (isumw & imax ) ;
2263 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) {
2266 ampl += weight[
sample]*shape(time) ;
2268 ss <<
"weight="<<weight[
sample]<<
" shape="<<shape(time)<<
"\n" ;
2271 ss <<
"Weights: sum (weight*shape) = "<<ampl<<
"\n" ;
2278 while (isumw != 0 && count<10) {
2280 unsigned int index = 0 ;
2283 ss <<
"Correcting for bias: adding 1\n" ;
2284 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) {
2285 int new_iweight = iweight[
sample]+1 ;
2287 if (fabs(new_weight-weight[sample])<min) {
2288 min = fabs(new_weight-weight[sample]) ;
2295 ss <<
"Correcting for bias: subtracting 1\n" ;
2296 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) {
2297 int new_iweight = iweight[
sample]-1 ;
2299 if (fabs(new_weight-weight[sample])<min) {
2300 min = fabs(new_weight-weight[sample]) ;
2307 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) isumw += iweight[sample] ;
2309 isumw = (isumw & imax ) ;
2310 ss <<
"Correcting weight number: "<< index <<
" sum weights = " << isumw<<
"\n" ;
2317 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) isumw += iweight[sample] ;
2319 isumw = (isumw & imax ) ;
2321 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) {
2326 ampl += new_weight*shape(time) ;
2327 ss <<
"weight unbiased after integer conversion="<<new_weight<<
" shape="<<shape(time)<<
"\n" ;
2330 ss <<
"Weights: sum (weight*shape) = "<<ampl<<
"\n" ;
2333 std::vector<unsigned int> theWeights ;
2334 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) theWeights.push_back(iweight[sample]) ;
2361 for (
int i=0 ;
i<1024 ;
i++) {
2363 if (lut[
i]>0xff) lut[
i] = 0xff ;
2369 for (
int i=0 ;
i<1024 ;
i++) {
2371 if ((
i+1)%4 == 0 ) mylut++ ;
2379 func->SetParameters(LUT_stochastic, LUT_noise, LUT_constant) ;
2380 double norm = func->Integral(0., Et_sat) ;
2381 for (
int i=0 ;
i<1024 ;
i++) {
2382 double Et =
i*Et_sat/1024. ;
2383 lut[
i] =
int(0xff*func->Integral(0., Et)/norm + 0.5) ;
2388 for (
int j=0 ; j<1024 ; j++) {
2389 double Et_GeV = Et_sat/1024*(j+0.5) ;
2390 if (Et_GeV <= LUT_threshold) lut[j] = 0 ;
2392 if (Et_GeV >= TTF_highThreshold) ttf = 3 ;
2393 if (Et_GeV >= TTF_lowThreshold && Et_GeV < TTF_highThreshold) ttf = 1 ;
2410 double alpha_factor = 1.0;
2413 icorr = itCorr->second;
2421 st =
"Transparency correction found for xtal " + ss.str() +
" corr=" + ss1.str() +
" intercalib=" + ss2.str() +
"\n";
2424 edm::LogError(
"TopInfo") <<
"ERROR = Transparency correction not found for xtal " << rawId <<
"\n";
2427 DetId ECALdetid(rawId);
2431 st +=
"DETID=" + ss.str() +
"\n";
2435 if ( italpha != laserAlphaMap.
end() ) alpha_factor = (*italpha);
2436 else edm::LogError(
"TopInfo") <<
"ERROR:LaserAlphe parameter note found!!" <<
"\n";
2441 if ( italpha != laserAlphaMap.
end() ) alpha_factor = (*italpha);
2442 else edm::LogError(
"TopInfo") <<
"ERROR:LaserAlphe parameter note found!!" <<
"\n";
2455 ss2 << alpha_factor;
2456 st +=
"rawId " + ss.str() +
" " + ss1.str() +
" " + ss2.str() +
"\n";
2459 else edm::LogError(
"TopInfo") <<
"getCoeff: "<<rawId<<
" not found in EcalIntercalibConstantMap"<<
"\n" ;
2469 if (gainIter != gainMap.
end()) {
2474 else edm::LogError(
"TopInfo") <<
"getCoeff: "<<rawId<<
" not found in EcalGainRatioMap"<<
"\n" ;
2492 if (pedIter != pedMap.
end()) {
2498 else edm::LogError(
"TopInfo") <<
"getCoeff: " << rawId <<
" not found in EcalPedestalsMap\n" ;
2508 map<EcalLogicID, MonPedestalsDat>::const_iterator it = pedMap.find(logicId);
2509 if (it != pedMap.end()) {
2516 <<
" not found in map<EcalLogicID, MonPedestalsDat\n" ;
2520 unsigned int & lowThreshold,
unsigned int & highThreshold,
unsigned int &
lut)
2523 if (lowRatio>0x7f) lowRatio = 0x7f ;
2525 if (highRatio>0x7f) highRatio = 0x7f ;
2530 if (lowThreshold>0xff) lowThreshold = 0xff ;
2532 if (highThreshold>0xff) highThreshold = 0xff ;
2558 for (
int i=1 ;
i<3 ;
i++) {
2562 }
else base[
i] = 0 ;
2565 for (
int i=0 ;
i<3 ;
i++) {
2569 edm::LogError(
"TopInfo") <<
"WARNING: base= "<<base[
i]<<
", "<<lin.
pedestal_[
i]<<
" for gainId[0-2]="<<
i<<
" ==> forcing at 0"<<
"\n" ;
2580 gctphi = (ttphi+1)/4;
2581 if(ttphi<=2) gctphi=0;
2582 if(ttphi>=71) gctphi=0;
2588 if(tteta>0) gcteta = (tteta-1)/4 + 11;
2589 else if(tteta<0) gcteta = (tteta+1)/4 + 10;
2594 std::stringstream sdet ;
2596 if (tcc>36 && tcc<55) sdet<<
"EB-"<<tcc-36 ;
2597 else if (tcc>=55 && tcc<73) sdet<<
"EB+"<<tcc-54 ;
2598 else if (tcc<=36) sdet<<
"EE-" ;
2601 if (tcc<=36 || tcc>=73) {
2602 if (tcc>=73) tcc-=72 ;
2603 if (tcc==1 || tcc==18 || tcc==19 || tcc==36) sdet<<7 ;
2604 else if (tcc==2 || tcc==3 || tcc==20 || tcc==21) sdet<<8 ;
2605 else if (tcc==4 || tcc==5 || tcc==22 || tcc==23) sdet<<9 ;
2606 else if (tcc==6 || tcc==7 || tcc==24 || tcc==25) sdet<<1 ;
2607 else if (tcc==8 || tcc==9 || tcc==26 || tcc==27) sdet<<2 ;
2608 else if (tcc==10 || tcc==11 || tcc==28 || tcc==29) sdet<<3 ;
2609 else if (tcc==12 || tcc==13 || tcc==30 || tcc==31) sdet<<4 ;
2610 else if (tcc==14 || tcc==15 || tcc==32 || tcc==33) sdet<<5 ;
2611 else if (tcc==16 || tcc==17 || tcc==34 || tcc==35) sdet<<6 ;
2618 std::stringstream crate ;
2623 if (tcc>=40 && tcc<=42) {crate<<
"02d" ; slot = 5 + (tcc-40)*6 ;}
2624 if (tcc>=43 && tcc<=45) {crate<<
"03d" ; slot = 5 + (tcc-43)*6 ;}
2625 if (tcc>=37 && tcc<=39) {crate<<
"04d" ; slot = 5 + (tcc-37)*6 ;}
2626 if (tcc>=52 && tcc<=54) {crate<<
"06d" ; slot = 5 + (tcc-52)*6 ;}
2627 if (tcc>=46 && tcc<=48) {crate<<
"07d" ; slot = 5 + (tcc-46)*6 ;}
2628 if (tcc>=49 && tcc<=51) {crate<<
"08d" ; slot = 5 + (tcc-49)*6 ;}
2629 if (tcc>=58 && tcc<=60) {crate<<
"02h" ; slot = 5 + (tcc-58)*6 ;}
2630 if (tcc>=61 && tcc<=63) {crate<<
"03h" ; slot = 5 + (tcc-61)*6 ;}
2631 if (tcc>=55 && tcc<=57) {crate<<
"04h" ; slot = 5 + (tcc-55)*6 ;}
2632 if (tcc>=70 && tcc<=72) {crate<<
"06h" ; slot = 5 + (tcc-70)*6 ;}
2633 if (tcc>=64 && tcc<=66) {crate<<
"07h" ; slot = 5 + (tcc-64)*6 ;}
2634 if (tcc>=67 && tcc<=69) {crate<<
"08h" ; slot = 5 + (tcc-67)*6 ;}
2636 if (tcc>=76 && tcc<=81) {
2638 if (tcc%2==0) slot = 2 + (tcc-76)*3 ;
2639 else slot = 4 + (tcc-77)*3 ;
2641 if (tcc>=94 && tcc<=99) {
2643 if (tcc%2==0) slot = 3 + (tcc-94)*3 ;
2644 else slot = 5 + (tcc-95)*3 ;
2647 if (tcc>=22 && tcc<=27) {
2649 if (tcc%2==0) slot = 2 + (tcc-22)*3 ;
2650 else slot = 4 + (tcc-23)*3 ;
2652 if (tcc>=4 && tcc<=9) {
2654 if (tcc%2==0) slot = 3 + (tcc-4)*3 ;
2655 else slot = 5 + (tcc-5)*3 ;
2658 if (tcc>=82 && tcc<=87) {
2660 if (tcc%2==0) slot = 2 + (tcc-82)*3 ;
2661 else slot = 4 + (tcc-83)*3 ;
2663 if (tcc>=100 && tcc<=105) {
2665 if (tcc%2==0) slot = 3 + (tcc-100)*3 ;
2666 else slot = 5 + (tcc-101)*3 ;
2669 if (tcc>=28 && tcc<=33) {
2671 if (tcc%2==0) slot = 2 + (tcc-28)*3 ;
2672 else slot = 4 + (tcc-29)*3 ;
2674 if (tcc>=10 && tcc<=15) {
2676 if (tcc%2==0) slot = 3 + (tcc-10)*3 ;
2677 else slot = 5 + (tcc-11)*3 ;
2680 if (tcc==34) {crate<<
"04l" ; slot = 2 ;}
2681 if (tcc==16) {crate<<
"04l" ; slot = 3 ;}
2682 if (tcc==35) {crate<<
"04l" ; slot = 4 ;}
2683 if (tcc==17) {crate<<
"04l" ; slot = 5 ;}
2684 if (tcc==36) {crate<<
"04l" ; slot = 8 ;}
2685 if (tcc==18) {crate<<
"04l" ; slot = 9 ;}
2686 if (tcc==19) {crate<<
"04l" ; slot = 10 ;}
2687 if (tcc==1) {crate<<
"04l" ; slot = 11 ;}
2688 if (tcc==20) {crate<<
"04l" ; slot = 14 ;}
2689 if (tcc==2) {crate<<
"04l" ; slot = 15 ;}
2690 if (tcc==21) {crate<<
"04l" ; slot = 16 ;}
2691 if (tcc==3) {crate<<
"04l" ; slot = 17 ;}
2693 if (tcc==88) {crate<<
"06l" ; slot = 2 ;}
2694 if (tcc==106) {crate<<
"06l" ; slot = 3 ;}
2695 if (tcc==89) {crate<<
"06l" ; slot = 4 ;}
2696 if (tcc==107) {crate<<
"06l" ; slot = 5 ;}
2697 if (tcc==90) {crate<<
"06l" ; slot = 8 ;}
2698 if (tcc==108) {crate<<
"06l" ; slot = 9 ;}
2699 if (tcc==73) {crate<<
"06l" ; slot = 10 ;}
2700 if (tcc==91) {crate<<
"06l" ; slot = 11 ;}
2701 if (tcc==74) {crate<<
"06l" ; slot = 14 ;}
2702 if (tcc==92) {crate<<
"06l" ; slot = 15 ;}
2703 if (tcc==75) {crate<<
"06l" ; slot = 16 ;}
2704 if (tcc==93) {crate<<
"06l" ; slot = 17 ;}
2706 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
const EcalLaserAPDPNRatiosMap & getLaserMap() 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)