27 #if (CMSSW_VERSION>=340)
49 if (Et<1
e-6)
return 1./par[1] ;
50 double resolEt_overEt =
sqrt( (par[0]/
sqrt(Et))*(par[0]/
sqrt(Et)) + (par[1]/Et)*(par[1]/Et) + par[2]*par[2] ) ;
51 return 1./(Et*resolEt_overEt) ;
55 : xtal_LSB_EB_(0), xtal_LSB_EE_(0), nSample_(5), complement2_(7)
86 string DBuser = pSet.
getParameter<std::string>(
"DBuser") ;
87 string DBpass = pSet.
getParameter<std::string>(
"DBpass") ;
112 if (
writeToDB_)
std::cout <<
"data will be saved with tag and version="<< tag_<<
".version"<<version_<< endl;
115 cout <<
"ERROR: " << e.what() << endl;
117 cout <<
"Unknown error caught" << endl;
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 std::cout <<
"INFO:SPIKE KILLING THRESHOLD (ADC)=" << SFGVB_SpikeKillingThreshold_ << std::endl;
187 std::cout <<
"INFO: READING timing files" << std::endl;
190 std::ifstream delay_ee(TimingDelays_EE_.c_str());
191 if(!delay_ee)
std::cout <<
"ERROR: File " << TimingDelays_EE_.c_str() <<
" could not be opened" << std::endl;
192 std::ifstream phase_eb(TimingPhases_EB_.c_str());
193 if(!phase_eb)
std::cout <<
"ERROR: File " << TimingPhases_EB_.c_str() <<
" could not be opened" << std::endl;
194 std::ifstream phase_ee(TimingPhases_EE_.c_str());
195 if(!phase_ee)
std::cout <<
"ERROR: File " << TimingPhases_EE_.c_str() <<
" could not be opened" << std::endl;
199 delay_eb.getline(buf,
sizeof(buf),
'\n');
201 std::stringstream
sin(buf);
206 vector<int> vec_delays_eb;
207 for(
int ieb=0; ieb<68; ++ieb){
210 vec_delays_eb.push_back(time_delay);
211 if(time_delay==-1)
std::cout <<
"ERROR:Barrel timing delay -1, check file" << std::endl;
214 if(vec_delays_eb.size()!=68)
215 std::cout <<
"ERROR:Barrel timing delay wrong, not enough towers, check file" << std::endl;
218 delays_EB_.insert(make_pair(tcc,vec_delays_eb));
221 for(
unsigned int ieb=0; ieb<vec_delays_eb.size(); ++ieb)
222 cout << vec_delays_eb[ieb] <<
" ";
225 delay_eb.getline(buf,
sizeof(buf),
'\n');
230 phase_eb.getline(buf,
sizeof(buf),
'\n');
232 std::stringstream
sin(buf);
236 vector<int> vec_phases_eb;
237 for(
unsigned int ieb=0; ieb<68; ++ieb){
240 vec_phases_eb.push_back(time_phase);
241 if(time_phase==-1)
std::cout <<
"ERROR:Barrel timing phase -1, check file" << std::endl;
244 if(vec_phases_eb.size()!=68)
245 std::cout <<
"ERROR:Barrel timing phase wrong, not enough towers, check file" << std::endl;
248 phases_EB_.insert(make_pair(tcc,vec_phases_eb));
251 for(
unsigned int ieb=0; ieb<vec_phases_eb.size(); ++ieb)
252 cout << vec_phases_eb[ieb] <<
" ";
255 phase_eb.getline(buf,
sizeof(buf),
'\n');
260 delay_ee.getline(buf,
sizeof(buf),
'\n');
262 std::stringstream
sin(buf);
266 vector<int> vec_delays_ee;
267 for(
unsigned int iee=0; iee<48; ++iee){
270 vec_delays_ee.push_back(time_delay);
271 if(time_delay==-1)
std::cout <<
"ERROR:EE timing delay -1, check file" << std::endl;
274 if(vec_delays_ee.size()!=48)
275 std::cout <<
"ERROR:EE timing delay wrong, not enough towers, check file" << std::endl;
278 delays_EE_.insert(make_pair(tcc,vec_delays_ee));
281 for(
unsigned int iee=0; iee<vec_delays_ee.size(); ++iee)
282 cout << vec_delays_ee[iee] <<
" ";
285 delay_ee.getline(buf,
sizeof(buf),
'\n');
291 phase_ee.getline(buf,
sizeof(buf),
'\n');
293 std::stringstream
sin(buf);
297 vector<int> vec_phases_ee;
298 for(
unsigned int iee=0; iee<48; ++iee){
301 vec_phases_ee.push_back(time_phase);
302 if(time_phase==-1)
std::cout <<
"ERROR:EE timing phase -1, check file" << std::endl;
305 if(vec_phases_ee.size()!=48)
306 std::cout <<
"ERROR:EE timing phase wrong, not enough towers, check file" << std::endl;
309 phases_EE_.insert(make_pair(tcc,vec_phases_ee));
312 for(
unsigned int iee=0; iee<vec_phases_ee.size(); ++iee)
313 cout << vec_phases_ee[iee] <<
" ";
316 phase_ee.getline(buf,
sizeof(buf),
'\n');
320 std::cout <<
"INFO: DONE reading timing files for EB and EE" << std::endl;
327 (*out_file_ )<<
"EOF"<<std::endl ;
337 if( item.mean_x1 <150. || item.mean_x1 >250) result=
false;
338 if( item.mean_x6 <150. || item.mean_x6 >250) result=
false;
339 if( item.mean_x12 <150. || item.mean_x12 >250) result=
false;
340 if( item.rms_x1 <0 || item.rms_x1 > 2) result=
false;
341 if( item.rms_x6 <0 || item.rms_x6 > 3) result=
false;
342 if( item.rms_x12 <0 || item.rms_x12 > 5) result=
false;
348 int etaSlice = (towerInTCC-1)/4+1 ;
350 if (tccId>36 || tccId<73)
return etaSlice ;
353 if (tccId >=1 && tccId <= 18) etaSlice += 21 ;
354 if (tccId >=19 && tccId <= 36) etaSlice += 17 ;
355 if (tccId >=91 && tccId <= 108) etaSlice += 21 ;
356 if (tccId >=73 && tccId <= 90) etaSlice += 17 ;
383 TFile saving (
"EcalTPGParam.root",
"recreate") ;
385 TH2F * ICEB =
new TH2F(
"ICEB",
"IC: Barrel", 360, 1, 361, 172, -86, 86) ;
386 ICEB->GetYaxis()->SetTitle(
"eta index") ;
387 ICEB->GetXaxis()->SetTitle(
"phi index") ;
388 TH2F * tpgFactorEB =
new TH2F(
"tpgFactorEB",
"tpgFactor: Barrel", 360, 1, 361, 172, -86, 86) ;
389 tpgFactorEB->GetYaxis()->SetTitle(
"eta index") ;
390 tpgFactorEB->GetXaxis()->SetTitle(
"phi index") ;
392 TH2F * ICEEPlus =
new TH2F(
"ICEEPlus",
"IC: Plus Endcap", 120, -9, 111, 120, -9, 111) ;
393 ICEEPlus->GetYaxis()->SetTitle(
"y index") ;
394 ICEEPlus->GetXaxis()->SetTitle(
"x index") ;
395 TH2F * tpgFactorEEPlus =
new TH2F(
"tpgFactorEEPlus",
"tpgFactor: Plus Endcap", 120, -9, 111, 120, -9, 111) ;
396 tpgFactorEEPlus->GetYaxis()->SetTitle(
"y index") ;
397 tpgFactorEEPlus->GetXaxis()->SetTitle(
"x index") ;
398 TH2F * ICEEMinus =
new TH2F(
"ICEEMinus",
"IC: Minus Endcap", 120, -9, 111, 120, -9, 111) ;
399 ICEEMinus->GetYaxis()->SetTitle(
"y index") ;
400 ICEEMinus->GetXaxis()->SetTitle(
"x index") ;
401 TH2F * tpgFactorEEMinus =
new TH2F(
"tpgFactorEEMinus",
"tpgFactor: Minus Endcap", 120, -9, 111, 120, -9, 111) ;
402 tpgFactorEEMinus->GetYaxis()->SetTitle(
"y index") ;
403 tpgFactorEEMinus->GetXaxis()->SetTitle(
"x index") ;
405 TH2F * IC =
new TH2F(
"IC",
"IC", 720, -acos(-1.), acos(-1.), 600, -3., 3.) ;
406 IC->GetYaxis()->SetTitle(
"eta") ;
407 IC->GetXaxis()->SetTitle(
"phi") ;
408 TH2F * tpgFactor =
new TH2F(
"tpgFactor",
"tpgFactor", 720, -acos(-1.), acos(-1.), 600, -3., 3.) ;
409 tpgFactor->GetYaxis()->SetTitle(
"eta") ;
410 tpgFactor->GetXaxis()->SetTitle(
"phi") ;
412 TH1F * hshapeEB =
new TH1F(
"shapeEB",
"shapeEB", 250, 0., 10.) ;
413 TH1F * hshapeEE =
new TH1F(
"shapeEE",
"shapeEE", 250, 0., 10.) ;
415 TTree * ntuple =
new TTree(
"tpgmap",
"TPG geometry map") ;
416 const std::string branchFloat[26] = {
"fed",
"tcc",
"tower",
"stripInTower",
"xtalInStrip",
417 "CCU",
"VFE",
"xtalInVFE",
"xtalInCCU",
"ieta",
"iphi",
418 "ix",
"iy",
"iz",
"hashedId",
"ic",
"cmsswId",
"dbId",
"ietaTT",
"iphiTT",
419 "TCCch",
"TCCslot",
"SLBch",
"SLBslot",
"ietaGCT",
"iphiGCT"} ;
421 for (
int i=0 ;
i<26 ;
i++) ntuple->Branch(branchFloat[
i].c_str(),&
ntupleInts_[
i],(branchFloat[
i]+string(
"/I")).c_str()) ;
426 TNtuple *ntupleSpike =
new TNtuple(
"spikeParam",
"Spike parameters",
"gainId:theta:G:g:ped:pedLin") ;
434 list<uint32_t> towerListEB ;
435 list<uint32_t> stripListEB ;
436 list<uint32_t> towerListEE ;
437 list<uint32_t> stripListEE ;
438 list<uint32_t>::iterator itList ;
440 map<int, uint32_t> stripMapEB ;
441 map<uint32_t, uint32_t> stripMapEBsintheta ;
449 std::cout <<
"Getting the pedestals from offline DB..."<<endl;
453 pedMap = pedHandle.
product()->getMap() ;
458 for (pedIter = pedMap.begin() ; pedIter != pedMap.end() && nPed<10 ; ++pedIter, nPed++) {
460 std::cout<<aped.mean_x12<<
", "<<aped.mean_x6<<
", "<<aped.mean_x1<<std::endl ;
463 std::cout <<
"Getting the pedestals from previous configuration"<<std::endl;
471 db_-> fetchConfigSet(&fe_main_info);
476 db_-> fetchConfigSet(&fe_ped_info);
477 std::map<EcalLogicID, FEConfigPedDat> dataset_TpgPed;
480 typedef std::map<EcalLogicID, FEConfigPedDat>::const_iterator CIfeped;
484 for (CIfeped
p = dataset_TpgPed.begin();
p != dataset_TpgPed.end();
p++)
489 std::string ecid_name=ecid_xt.
getName();
492 if (ecid_name==
"EB_crystal_number") {
495 int sm_num=ecid_xt.
getID1();
496 int xt_num=ecid_xt.
getID2();
507 if(icells<10)
std::cout <<
" copy the EB data " <<
" ped = " << item.mean_x12<< std::endl;
512 }
else if (ecid_name==
"EE_crystal_number"){
536 for (pedIter = pedMap.begin() ; pedIter != pedMap.end() && nPed<10 ; ++pedIter, nPed++) {
538 std::cout<<aped.mean_x12<<
", "<<aped.mean_x6<<
", "<<aped.mean_x1<<std::endl ;
543 cout <<
" error reading previous pedestals " << endl;
545 cout <<
"Unknown error reading previous pedestals " << endl;
562 db_-> fetchConfigSet(&fe_ped_info);
563 std::map<EcalLogicID, FEConfigPedDat> dataset_TpgPed;
566 typedef std::map<EcalLogicID, FEConfigPedDat>::const_iterator CIfeped;
570 for (CIfeped
p = dataset_TpgPed.begin();
p != dataset_TpgPed.end();
p++)
575 std::string ecid_name=ecid_xt.
getName();
578 if (ecid_name==
"EB_crystal_number") {
579 if(icells<10)
std::cout <<
" copy the EB data " <<
" icells = " << icells << std::endl;
580 int sm_num=ecid_xt.
getID1();
581 int xt_num=ecid_xt.
getID2();
594 }
else if (ecid_name==
"EE_crystal_number"){
618 for (pedIter = pedMap.begin() ; pedIter != pedMap.end() && nPed<10 ; ++pedIter, nPed++) {
620 std::cout<<aped.mean_x12<<
", "<<aped.mean_x6<<
", "<<aped.mean_x1<<std::endl ;
625 cout <<
" error reading previous pedestals " << endl;
627 cout <<
"Unknown error reading previous pedestals " << endl;
639 std::cout <<
"Getting intercalib from offline DB..."<<endl;
646 for (calIter = calibMap.begin() ; calIter != calibMap.end() && nCal<10 ; ++calIter, nCal++) {
650 float calibvec[1700] ;
652 std::cout<<
"H2: overwriting IC coef with file"<<std::endl ;
656 std::string strdata ;
657 if (calibfile.is_open()) {
658 calibfile >> strdata >> strdata >> strdata >> strdata >> strdata ;
659 while(!calibfile.eof()) {
660 calibfile >> idata >> icry >> fcali >> fdata >> fdata ;
661 calibvec[icry-1] = fcali ;
670 std::cout <<
"Getting the gain ratios from offline DB..."<<endl;
676 for (gainIter = gainMap.begin() ; gainIter != gainMap.end() && nGain<10 ; ++gainIter, nGain++) {
684 std::cout <<
"Getting the ADC to GEV from offline DB..."<<endl;
695 vector<EcalLogicID> my_EcalLogicId;
696 vector<EcalLogicID> my_TTEcalLogicId;
697 vector<EcalLogicID> my_StripEcalLogicId;
701 vector<EcalLogicID> my_TTEcalLogicId_EE;
702 vector<EcalLogicID> my_RTEcalLogicId_EE;
703 vector<EcalLogicID> my_StripEcalLogicId1_EE;
704 vector<EcalLogicID> my_StripEcalLogicId2_EE;
705 vector<EcalLogicID> my_CrystalEcalLogicId_EE;
706 vector<EcalLogicID> my_TTEcalLogicId_EB_by_TCC;
707 vector<EcalLogicID> my_StripEcalLogicId_EE_strips_by_TCC;
710 std::cout<<
"going to get the ecal logic id set"<< endl;
717 "EB_crystal_number",12 );
722 "EB_trigger_tower",12 );
724 std::cout<<
"got the 3 ecal barrel logic id set"<< endl;
731 "EE_crystal_number",123 );
739 "ECAL_readout_strip",123 );
746 "ECAL_readout_strip",123 );
754 "EE_trigger_strip",123 );
764 "ECAL_trigger_tower",12 );
772 "EE_trigger_tower",12 );
780 "EE_readout_tower",12 );
782 std::cout<<
"got the end cap logic id set"<< endl;
785 std::cout<<
"Getting the latest ids for this tag (latest version) "<< endl;
792 db_-> fetchConfigSet(&fe_main_info);
810 cout <<
" tag did not exist a new tag will be created " << endl;
812 cout <<
"Unknown error caught" << endl;
821 map<EcalLogicID, FEConfigPedDat> pedset ;
822 map<EcalLogicID, FEConfigLinDat> linset ;
823 map<EcalLogicID, FEConfigLinParamDat> linparamset ;
824 map<EcalLogicID, FEConfigLUTParamDat> lutparamset ;
825 map<EcalLogicID, FEConfigFgrParamDat> fgrparamset ;
827 map<int, linStruc> linEtaSlice ;
828 map< vector<int>,
linStruc > linMap ;
831 int NbOfStripPerTCC[108][68] ;
832 for (
int i=0 ;
i<108 ;
i++)
833 for (
int j=0 ;
j<68 ;
j++)
834 NbOfStripPerTCC[
i][
j] = 0 ;
837 for (vector<DetId>::const_iterator it = ebCells.begin(); it != ebCells.end(); ++it) {
844 if (stripInTower>NbOfStripPerTCC[tccNb-1][towerInTCC-1]) NbOfStripPerTCC[tccNb-1][towerInTCC-1] = stripInTower ;
846 for (vector<DetId>::const_iterator it = eeCells.begin(); it != eeCells.end(); ++it) {
853 if (stripInTower>NbOfStripPerTCC[tccNb-1][towerInTCC-1]) NbOfStripPerTCC[tccNb-1][towerInTCC-1] = stripInTower ;
859 if (
writeToFiles_) (*out_file_)<<
"COMMENT ====== barrel crystals ====== "<<std::endl ;
862 for (vector<DetId>::const_iterator it = ebCells.begin(); it != ebCells.end(); ++it) {
876 int xtalInVFE = Id.
xtalId() ;
877 int xtalWithinCCUid = 5*(VFEid-1) + xtalInVFE -1 ;
879 (*geomFile_)<<
"dccNb = "<<dccNb<<
" tccNb = "<<tccNb<<
" towerInTCC = "<<towerInTCC
880 <<
" stripInTower = "<<stripInTower<<
" xtalInStrip = "<<xtalInStrip
881 <<
" CCUid = "<<CCUid<<
" VFEid = "<<VFEid<<
" xtalInVFE = "<<xtalInVFE
882 <<
" xtalWithinCCUid = "<<xtalWithinCCUid<<
" ieta = "<<
id.ieta()<<
" iphi = "<<
id.iphi()
883 <<
" xtalhashedId = "<<
id.hashedIndex()<<
" xtalNb = "<<
id.ic()
884 <<
" ietaTT = "<<towid.
ieta()<<
" iphiTT = "<<towid.
iphi()<<endl ;
886 int TCCch = towerInTCC ;
887 int SLBslot = int((towerInTCC-1)/8.) + 1 ;
888 int SLBch = (towerInTCC-1)%8 + 1 ;
889 int cmsswId =
id.rawId() ;
890 int ixtal=(
id.ism()-1)*1700+(
id.ic()-1);
893 int val[] = {dccNb+600,tccNb,towerInTCC,stripInTower,
894 xtalInStrip,CCUid,VFEid,xtalInVFE,xtalWithinCCUid,
id.ieta(),
id.iphi(),
896 id.ic(), cmsswId, dbId,
906 if (tccNb == 37 && stripInTower == 3 && xtalInStrip == 3 && (towerInTCC-1)%4==0) {
907 int etaSlice = towid.
ietaAbs() ;
909 getCoeff(coeff, calibMap,
id.rawId()) ;
910 getCoeff(coeff, gainMap,
id.rawId()) ;
911 getCoeff(coeff, pedMap,
id.rawId()) ;
913 for (
int i=0 ;
i<3 ;
i++) {
916 if (!ok)
std::cout <<
"unable to compute the parameters for SM="<<
id.ism()<<
" xt="<<
id.ic()<<
" " <<dec<<
id.rawId()<<std::endl ;
926 if (!ok)
std::cout<<
"SM="<<
id.ism()<<
" xt="<<
id.ic()<<
" " <<dec<<
id.rawId()<<std::endl ;
927 linEtaSlice[etaSlice] = lin ;
932 for (vector<DetId>::const_iterator it = ebCells.begin(); it != ebCells.end(); ++it) {
937 towerListEB.push_back(towid.
rawId()) ;
939 stripListEB.push_back(elId.
rawId() & 0xfffffff8) ;
948 int xtalInVFE = Id.
xtalId() ;
949 int xtalWithinCCUid = 5*(VFEid-1) + xtalInVFE -1 ;
950 int etaSlice = towid.
ietaAbs() ;
953 int hashedStripLogicID = 68*5*(
id.ism()-1) + 5*(towerInTCC-1) + (VFEid-1) ;
954 stripMapEB[hashedStripLogicID] = elId.
rawId() & 0xfffffff8 ;
971 if (
writeToFiles_) (*out_file_)<<
"CRYSTAL "<<dec<<
id.rawId()<<std::endl ;
975 getCoeff(coeff, calibMap,
id.rawId()) ;
977 getCoeff(coeff, gainMap,
id.rawId()) ;
978 getCoeff(coeff, pedMap,
id.rawId()) ;
979 ICEB->Fill(
id.iphi(),
id.ieta(), coeff.
calibCoeff_) ;
982 vector<int> xtalCCU ;
983 xtalCCU.push_back(dccNb+600) ;
984 xtalCCU.push_back(CCUid) ;
985 xtalCCU.push_back(xtalWithinCCUid) ;
986 xtalCCU.push_back(
id.rawId()) ;
991 map<int, linStruc>::const_iterator itLin = linEtaSlice.find(etaSlice);
992 if (itLin != linEtaSlice.end()) {
993 linMap[xtalCCU] = itLin->second ;
995 for (
int i=0 ;
i<3 ;
i++)
996 (*
out_file_) << hex <<
" 0x"<<itLin->second.pedestal_[
i]<<
" 0x"<<itLin->second.mult_[
i]<<
" 0x"<<itLin->second.shift_[
i]<<std::endl;
999 for (
int i=0 ;
i<3 ;
i++) {
1005 float factor = float(itLin->second.mult_[0])*
pow(2.,-itLin->second.shift_[0])/
xtal_LSB_EB_ ;
1006 tpgFactorEB->Fill(
id.iphi(),
id.ieta(), factor) ;
1010 else std::cout<<
"current EtaSlice = "<<etaSlice<<
" not found in the EtaSlice map"<<std::endl ;
1015 int forceBase12 = 0 ;
1016 for (
int i=0 ;
i<3 ;
i++) {
1019 if (!ok)
std::cout <<
"unable to compute the parameters for SM="<<
id.ism()<<
" xt="<<
id.ic()<<
" " <<dec<<
id.rawId()<<std::endl ;
1031 double G = mult*
pow(2.0,-(shift+2)) ;
1032 double g = G/
sin(theta) ;
1034 base = double(coeff.
pedestals_[
i]) - pedestal_offset_/
g ;
1035 if (base<0.) base = 0 ;
1036 forceBase12 = int(base) ;
1055 if (!ok)
std::cout<<
"SM="<<
id.ism()<<
" xt="<<
id.ic()<<
" " <<dec<<
id.rawId()<<std::endl ;
1057 for (
int i=0 ;
i<3 ;
i++) {
1066 tpgFactorEB->Fill(
id.iphi(),
id.ieta(), factor) ;
1071 double g = G/
sin(theta) ;
1072 float val[] = { float(
i),
1078 ntupleSpike->Fill(val) ;
1080 linMap[xtalCCU] = lin ;
1084 int ixtal=(
id.ism()-1)*1700+(
id.ic()-1);
1086 pedset[logicId] = pedDB ;
1087 linset[logicId] = linDB ;
1095 linparamset[my_EcalLogicId_EB] = linparam ;
1102 fgrparamset[my_EcalLogicId_EB] = fgrparam ;
1109 lutparamset[my_EcalLogicId_EB] = lutparam ;
1115 if (
writeToFiles_) (*out_file_)<<
"COMMENT ====== endcap crystals ====== "<<std::endl ;
1118 for (vector<DetId>::const_iterator it = eeCells.begin(); it != eeCells.end(); ++it) {
1125 int dccNb = Id.
dccId() ;
1132 int xtalInVFE = Id.
xtalId() ;
1133 int xtalWithinCCUid = 5*(VFEid-1) + xtalInVFE -1 ;
1135 (*geomFile_)<<
"dccNb = "<<dccNb<<
" tccNb = "<<tccNb<<
" towerInTCC = "<<towerInTCC
1136 <<
" stripInTower = "<<stripInTower<<
" xtalInStrip = "<<xtalInStrip
1137 <<
" CCUid = "<<CCUid<<
" VFEid = "<<VFEid<<
" xtalInVFE = "<<xtalInVFE
1138 <<
" xtalWithinCCUid = "<<xtalWithinCCUid<<
" ix = "<<
id.ix()<<
" iy = "<<
id.iy()
1139 <<
" xtalhashedId = "<<
id.hashedIndex()<<
" xtalNb = "<<
id.isc()
1140 <<
" ietaTT = "<<towid.
ieta()<<
" iphiTT = "<<towid.
iphi()<<endl ;
1142 int TCCch = stripInTower ;
1143 int SLBslot, SLBch ;
1146 SLBch = 4 + towerInTCC ;
1149 SLBslot = int((towerInTCC-5)/8.) + 2 ;
1150 SLBch = (towerInTCC-5)%8 + 1 ;
1152 for (
int j=0 ;
j<towerInTCC-1 ;
j++) TCCch += NbOfStripPerTCC[tccNb-1][
j] ;
1154 int cmsswId =
id.rawId() ;
1156 int iz =
id.positiveZ() ;
1157 if (iz ==0) iz = -1 ;
1158 for (
int k=0;
k<(int)my_CrystalEcalLogicId_EE.size();
k++) {
1159 int z= my_CrystalEcalLogicId_EE[
k].getID1() ;
1160 int x= my_CrystalEcalLogicId_EE[
k].getID2() ;
1161 int y= my_CrystalEcalLogicId_EE[
k].getID3() ;
1162 if (
id.ix()==x &&
id.iy()==y && iz==z) logicId=my_CrystalEcalLogicId_EE[
k];
1166 int val[] = {dccNb+600,tccNb,towerInTCC,stripInTower,
1167 xtalInStrip,CCUid,VFEid,xtalInVFE,xtalWithinCCUid,-999,-999,
1169 id.ic(),cmsswId, dbId,
1177 if ((tccNb == 76 || tccNb == 94) && stripInTower == 1 && xtalInStrip == 3 && (towerInTCC-1)%4==0) {
1178 int etaSlice = towid.
ietaAbs() ;
1180 getCoeff(coeff, calibMap,
id.rawId()) ;
1181 getCoeff(coeff, gainMap,
id.rawId()) ;
1182 getCoeff(coeff, pedMap,
id.rawId()) ;
1184 for (
int i=0 ;
i<3 ;
i++) {
1187 if (!ok)
std::cout <<
"unable to compute the parameters for Quadrant="<<
id.iquadrant()<<
" xt="<<
id.ic()<<
" " <<dec<<
id.rawId()<<std::endl ;
1197 if (!ok)
std::cout<<
"Quadrant="<<
id.iquadrant()<<
" xt="<<
id.ic()<<
" " <<dec<<
id.rawId()<<std::endl ;
1199 linEtaSlice[etaSlice] = lin ;
1204 for (vector<DetId>::const_iterator it = eeCells.begin(); it != eeCells.end(); ++it) {
1211 towerListEE.push_back(towid.
rawId()) ;
1215 towerListEE.push_back(additionalTower.rawId()) ;
1217 stripListEE.push_back(elId.
rawId() & 0xfffffff8) ;
1218 int dccNb = Id.
dccId() ;
1225 int xtalInVFE = Id.
xtalId() ;
1226 int xtalWithinCCUid = 5*(VFEid-1) + xtalInVFE -1 ;
1227 int etaSlice = towid.
ietaAbs() ;
1232 if (
writeToFiles_) (*out_file_)<<
"CRYSTAL "<<dec<<
id.rawId()<<std::endl ;
1234 int iz =
id.positiveZ() ;
1235 if (iz ==0) iz = -1 ;
1236 for (
int k=0;
k<(int)my_CrystalEcalLogicId_EE.size();
k++) {
1237 int z= my_CrystalEcalLogicId_EE[
k].getID1() ;
1238 int x= my_CrystalEcalLogicId_EE[
k].getID2() ;
1239 int y= my_CrystalEcalLogicId_EE[
k].getID3() ;
1240 if (
id.ix()==x &&
id.iy()==y && iz==z) logicId=my_CrystalEcalLogicId_EE[
k];
1245 getCoeff(coeff, calibMap,
id.rawId()) ;
1246 getCoeff(coeff, gainMap,
id.rawId()) ;
1247 getCoeff(coeff, pedMap,
id.rawId()) ;
1248 if (
id.zside()>0) ICEEPlus->Fill(
id.ix(),
id.iy(), coeff.
calibCoeff_) ;
1249 else ICEEMinus->Fill(
id.ix(),
id.iy(), coeff.
calibCoeff_) ;
1252 vector<int> xtalCCU ;
1253 xtalCCU.push_back(dccNb+600) ;
1254 xtalCCU.push_back(CCUid) ;
1255 xtalCCU.push_back(xtalWithinCCUid) ;
1256 xtalCCU.push_back(
id.rawId()) ;
1261 map<int, linStruc>::const_iterator itLin = linEtaSlice.find(etaSlice);
1262 if (itLin != linEtaSlice.end()) {
1263 linMap[xtalCCU] = itLin->second ;
1265 for (
int i=0 ;
i<3 ;
i++)
1266 (*
out_file_) << hex <<
" 0x"<<itLin->second.pedestal_[
i]<<
" 0x"<<itLin->second.mult_[
i]<<
" 0x"<<itLin->second.shift_[
i]<<std::endl;
1269 for (
int i=0 ;
i<3 ;
i++) {
1275 float factor = float(itLin->second.mult_[0])*
pow(2.,-itLin->second.shift_[0])/
xtal_LSB_EE_ ;
1276 if (
id.zside()>0) tpgFactorEEPlus->Fill(
id.ix(),
id.iy(), factor) ;
1277 else tpgFactorEEMinus->Fill(
id.ix(),
id.iy(), factor) ;
1281 else std::cout<<
"current EtaSlice = "<<etaSlice<<
" not found in the EtaSlice map"<<std::endl ;
1286 for (
int i=0 ;
i<3 ;
i++) {
1289 if (!ok)
std::cout <<
"unable to compute the parameters for "<<dec<<
id.rawId()<<std::endl ;
1299 if (!ok)
std::cout<<
"Quadrant="<<
id.iquadrant()<<
" xt="<<
id.ic()<<
" " <<dec<<
id.rawId()<<std::endl ;
1301 for (
int i=0 ;
i<3 ;
i++) {
1310 if (
id.zside()>0) tpgFactorEEPlus->Fill(
id.ix(),
id.iy(), factor) ;
1311 else tpgFactorEEMinus->Fill(
id.ix(),
id.iy(), factor) ;
1316 linMap[xtalCCU] = lin ;
1319 pedset[logicId] = pedDB ;
1320 linset[logicId] = linDB ;
1328 linparamset[my_EcalLogicId_EE] = linparam ;
1334 lutparamset[my_EcalLogicId_EE] = lutparam ;
1340 fgrparamset[my_EcalLogicId_EE] = fgrparam ;
1348 std::string lin_tag=ltag.str();
1364 evgueni<<
"void getLinParamTPG_hardcoded(int fed, int ccu, int xtal,"<<endl ;
1365 evgueni<<
" int & mult12, int & shift12, int & base12,"<<endl ;
1366 evgueni<<
" int & mult6, int & shift6, int & base6,"<<endl ;
1367 evgueni<<
" int & mult1, int & shift1, int & base1)"<<endl ;
1369 evgueni<<
" mult12 = 0 ; shift12 = 0 ; base12 = 0 ; mult6 = 0 ; shift6 = 0 ; base6 = 0 ; mult1 = 0 ; shift1 = 0 ; base1 = 0 ;"<<endl ;
1370 map< vector<int>,
linStruc>::const_iterator itLinMap ;
1371 for (itLinMap = linMap.begin() ; itLinMap != linMap.end() ; itLinMap++) {
1372 vector<int> xtalInCCU = itLinMap->first ;
1373 evgueni<<
" if (fed=="<<xtalInCCU[0]<<
" && ccu=="<<xtalInCCU[1]<<
" && xtal=="<<xtalInCCU[2]<<
") {" ;
1374 evgueni<<
" mult12 = "<<itLinMap->second.
mult_[0]<<
" ; shift12 = "<<itLinMap->second.shift_[0]<<
" ; base12 = "<<itLinMap->second.pedestal_[0]<<
" ; " ;
1375 evgueni<<
" mult6 = "<<itLinMap->second.mult_[1]<<
" ; shift6 = "<<itLinMap->second.shift_[1]<<
" ; base6 = "<<itLinMap->second.pedestal_[1]<<
" ; " ;
1376 evgueni<<
" mult1 = "<<itLinMap->second.mult_[2]<<
" ; shift1 = "<<itLinMap->second.shift_[2]<<
" ; base1 = "<<itLinMap->second.pedestal_[2]<<
" ; " ;
1377 evgueni<<
" return ;}" <<endl ;
1379 evgueni<<
"}" <<endl ;
1388 const int NWEIGROUPS = 2 ;
1389 std::vector<unsigned int>
weights[NWEIGROUPS] ;
1391 #if (CMSSW_VERSION>=340)
1403 weights[1] = weights[0] ;
1406 map<EcalLogicID, FEConfigWeightGroupDat>
dataset;
1408 for (
int igrp=0 ; igrp<NWEIGROUPS ; igrp++) {
1410 if (weights[igrp].
size() == 5) {
1413 (*out_file_) <<std::endl ;
1414 (*out_file_) <<
"WEIGHT "<<igrp<<endl ;
1416 (*out_file_)<<std::endl ;
1417 (*out_file_) <<std::endl ;
1420 std::cout<<
"going to write the weights for groupe:"<<igrp<<endl;
1431 dataset[ecid] = gut;
1439 map<EcalLogicID, FEConfigWeightDat> dataset2;
1442 for (
int ich=0; ich<(int)my_StripEcalLogicId.size() ; ich++){
1446 dataset2[my_StripEcalLogicId[ich]] = wut;
1450 for (
int ich=0; ich<(int)my_StripEcalLogicId1_EE.size() ; ich++){
1455 dataset2[my_StripEcalLogicId1_EE[ich]] = wut;
1458 for (
int ich=0; ich<(int)my_StripEcalLogicId2_EE.size() ; ich++){
1463 dataset2[my_StripEcalLogicId2_EE[ich]] = wut;
1468 wtag.str(
""); wtag<<
"Shape_NGroups_"<<NWEIGROUPS;
1469 std::string weight_tag=wtag.str();
1470 std::cout<<
" weight tag "<<weight_tag<<endl;
1480 unsigned int lowRatio, highRatio, lowThreshold, highThreshold, lutFG ;
1483 (*out_file_) <<std::endl ;
1484 (*out_file_) <<
"FG 0"<<std::endl ;
1485 (*out_file_)<<hex<<
"0x"<<lowThreshold<<
" 0x"<<highThreshold
1486 <<
" 0x"<<lowRatio<<
" 0x"<<highRatio<<
" 0x"<<lutFG
1492 unsigned int lut_strip;
1499 std::cout<<
"going to write the fgr "<< endl;
1500 map<EcalLogicID, FEConfigFgrGroupDat>
dataset;
1503 for (
int ich=0; ich<NFGRGROUPS; ich++){
1513 dataset[ecid] = gut;
1517 map<EcalLogicID, FEConfigFgrDat> dataset2;
1519 for (
int ich=0; ich<(int)my_TTEcalLogicId.size() ; ich++){
1526 dataset2[my_TTEcalLogicId[ich]] = wut;
1530 for (
int ich=0; ich<(int)my_RTEcalLogicId_EE.size() ; ich++){
1538 dataset2[my_RTEcalLogicId_EE[ich]] = wut;
1542 map<EcalLogicID, FEConfigFgrEETowerDat> dataset3;
1543 for (
int ich=0; ich<(int)my_TTEcalLogicId_EE.size() ; ich++){
1546 dataset3[my_TTEcalLogicId_EE[ich]]=fgreett;
1551 map<EcalLogicID, FEConfigFgrEEStripDat> dataset4;
1552 for (
int ich=0; ich<(int)my_StripEcalLogicId1_EE.size() ; ich++){
1556 dataset4[my_StripEcalLogicId1_EE[ich]] = zut;
1558 for (
int ich=0; ich<(int)my_StripEcalLogicId2_EE.size() ; ich++){
1563 dataset4[my_StripEcalLogicId2_EE[ich]] = zut;
1565 for (
int ich=0; ich<(int)my_StripEcalLogicId.size() ; ich++){
1569 uint32_t elStripId = stripMapEB[ich] ;
1570 map<uint32_t, uint32_t>::const_iterator it = stripMapEBsintheta.find(elStripId) ;
1571 if (it != stripMapEBsintheta.end()) zut.
setThreshold(it->second);
1573 cout<<
"ERROR: strip SFGVB threshold parameter not found for that strip:"<<thestrip.
getID1()<<
" "<<thestrip.
getID3()<<
" "<<thestrip.
getID3()<<endl ;
1579 dataset4[thestrip] = zut;
1585 std::string weight_tag=wtag.str();
1586 std::cout<<
" weight tag "<<weight_tag<<endl;
1590 map<EcalLogicID, FEConfigSpikeDat> datasetspike;
1591 for (
int ich=0; ich<(int)my_TTEcalLogicId.size() ; ich++){
1594 datasetspike[my_TTEcalLogicId[ich]] = spiketh;
1600 std::string spike_tag=stag.str();
1601 std::cout<<
" spike tag "<<spike_tag<<endl;
1606 map<EcalLogicID, FEConfigTimingDat> datasetdelay;
1607 for (
int ich=0; ich<(int)my_TTEcalLogicId_EB_by_TCC.size() ; ich++){
1610 EcalLogicID logiciddelay = my_TTEcalLogicId_EB_by_TCC[ich] ;
1611 int id1_tcc=my_TTEcalLogicId_EB_by_TCC[ich].
getID1();
1612 int id2_tt =my_TTEcalLogicId_EB_by_TCC[ich].getID2();
1613 std::map<int, vector<int> >::const_iterator ittEB =
delays_EB_.find(id1_tcc);
1614 std::vector<int> TimingDelaysEB = ittEB->second;
1617 if(TimingDelaysEB[id2_tt-1] == -1){
1618 std::cout <<
"ERROR: Barrel timing delay not specified, check file, putting default value 1" << std::endl;
1623 std::cout <<
"ERROR:Barrel Could not find delay parameter for that trigger tower " << std::endl;
1624 std::cout <<
"Using default value = 1" << std::endl;
1628 std::map<int, vector<int> >::const_iterator ittpEB =
phases_EB_.find(id1_tcc);
1629 std::vector<int> TimingPhasesEB = ittpEB->second;
1632 if(TimingPhasesEB[id2_tt-1] == -1){
1633 std::cout <<
"ERROR: Barrel timing phase not specified, check file, putting default value 0" << std::endl;
1638 std::cout <<
"ERROR:Barrel Could not find phase parameter for that trigger tower " << std::endl;
1639 std::cout <<
"Using default value = 0" << std::endl;
1643 std::cout << ich <<
" tcc=" << id1_tcc <<
" TT=" << id2_tt <<
" logicId=" << logiciddelay.
getLogicID()
1644 <<
" delay=" << TimingDelaysEB[id2_tt-1] <<
" phase=" << TimingPhasesEB[id2_tt-1] << std::endl;
1648 datasetdelay[my_TTEcalLogicId_EB_by_TCC[ich]] = delay;
1654 for (
int ich=0; ich<(int)my_StripEcalLogicId_EE_strips_by_TCC.size() ; ich++){
1660 EcalLogicID logiciddelay = my_StripEcalLogicId_EE_strips_by_TCC[ich] ;
1661 int id1_tcc=my_StripEcalLogicId_EE_strips_by_TCC[ich].
getID1();
1662 int id2_tt =my_StripEcalLogicId_EE_strips_by_TCC[ich].getID2();
1663 int id3_st =my_StripEcalLogicId_EE_strips_by_TCC[ich].getID3();
1666 if(id1_tcc != tccin) {tccin = id1_tcc; stripindex=0;}
1668 std::map<int, vector<int> >::const_iterator ittEE =
delays_EE_.find(id1_tcc);
1669 std::vector<int> TimingDelaysEE = ittEE->second;
1672 if(TimingDelaysEE[stripindex] == -1){
1673 std::cout <<
"ERROR: Endcap timing delay not specified, check file, putting default value 1" << std::endl;
1678 std::cout <<
"ERROR:Endcap Could not find delay parameter for that trigger tower " << std::endl;
1679 std::cout <<
"Using default value = 1" << std::endl;
1683 std::map<int, vector<int> >::const_iterator ittpEE =
phases_EE_.find(id1_tcc);
1684 std::vector<int> TimingPhasesEE = ittpEE->second;
1687 if(TimingPhasesEE[stripindex] == -1){
1688 std::cout <<
"ERROR: Endcap timing phase not specified, check file, putting default value 0" << std::endl;
1693 std::cout <<
"ERROR:Endcap Could not find phase parameter for that trigger tower " << std::endl;
1694 std::cout <<
"Using default value = 0" << std::endl;
1698 std::cout << ich <<
" stripindex=" << stripindex <<
" tcc=" << id1_tcc <<
" TT=" << id2_tt <<
" id3_st=" << id3_st
1700 <<
" delay=" << TimingDelaysEE[stripindex] <<
" phase=" << TimingPhasesEE[stripindex] << std::endl;
1705 datasetdelay[my_StripEcalLogicId_EE_strips_by_TCC[ich]] = delay;
1709 ostringstream de_tag;
1710 de_tag.str(
""); de_tag<<
"DelaysFromFile";
1711 std::string delay_tag=de_tag.str();
1712 std::cout<<
" delay tag "<<delay_tag<<endl;
1719 std::cout<<
"going to write the sliding "<< endl;
1720 map<EcalLogicID, FEConfigSlidingDat>
dataset;
1722 for (
int ich=0; ich<(int)my_StripEcalLogicId.size() ; ich++){
1728 dataset[my_StripEcalLogicId[ich]] = wut;
1732 for (
int ich=0; ich<(int)my_StripEcalLogicId1_EE.size() ; ich++){
1738 dataset[my_StripEcalLogicId1_EE[ich]] = wut;
1740 for (
int ich=0; ich<(int)my_StripEcalLogicId2_EE.size() ; ich++){
1746 dataset[my_StripEcalLogicId2_EE[ich]] = wut;
1752 wtag.str(
""); wtag<<
"Sliding_"<<
sliding_;
1753 std::string justatag=wtag.str();
1754 std::cout<<
" sliding tag "<<justatag<<endl;
1767 int lut_EB[1024], lut_EE[1024] ;
1772 (*out_file_) <<std::endl ;
1773 (*out_file_) <<
"LUT 0"<<std::endl ;
1774 for (
int i=0 ;
i<1024 ;
i++) (*
out_file_)<<
"0x"<<hex<<lut_EB[
i]<<endl ;
1775 (*out_file_)<<endl ;
1781 bool newLUT(
false) ;
1782 for (
int i=0 ;
i<1024 ;
i++)
if (lut_EE[
i] != lut_EB[
i]) newLUT =
true ;
1784 (*out_file_) <<std::endl ;
1785 (*out_file_) <<
"LUT 1"<<std::endl ;
1786 for (
int i=0 ; i<1024 ; i++) (*
out_file_)<<
"0x"<<hex<<lut_EE[
i]<<endl ;
1787 (*out_file_)<<endl ;
1796 map<EcalLogicID, FEConfigLUTGroupDat>
dataset;
1802 for (
int i=0; i<1024; i++){
1807 dataset[ecid] =
lut;
1813 for (
int i=0; i<1024; i++){
1818 dataset[ecide] =
lute;
1825 map<EcalLogicID, FEConfigLUTDat> dataset2;
1827 for (
int ich=0; ich<(int)my_TTEcalLogicId.size() ; ich++){
1833 dataset2[my_TTEcalLogicId[ich]] =
lut;
1837 for (
int ich=0; ich<(int)my_TTEcalLogicId_EE.size() ; ich++){
1843 dataset2[my_TTEcalLogicId_EE[ich]] =
lut;
1848 ltag.str(
""); ltag<<
LUT_option_<<
"_NGroups_"<<NLUTGROUPS;
1849 std::string lut_tag=ltag.str();
1863 std::cout <<
"\n Conf ID = " << conf_id_ << std::endl;
1873 stripListEB.sort() ;
1874 stripListEB.unique() ;
1875 cout<<
"Number of EB strips="<<dec<<stripListEB.size()<<endl ;
1877 (*out_file_) <<std::endl ;
1878 for (itList = stripListEB.begin(); itList != stripListEB.end(); itList++ ) {
1879 (*out_file_) <<
"STRIP_EB "<<dec<<(*itList)<<endl ;
1880 (*out_file_) << hex <<
"0x" <<
sliding_<<std::endl ;
1881 (*out_file_) <<
"0" <<std::endl ;
1882 (*out_file_) <<
"0x"<<stripMapEBsintheta[(*itList)] <<
" 0x" <<
SFGVB_lut_ <<std::endl ;
1887 stripListEE.sort() ;
1888 stripListEE.unique() ;
1889 cout<<
"Number of EE strips="<<dec<<stripListEE.size()<<endl ;
1891 (*out_file_) <<std::endl ;
1892 for (itList = stripListEE.begin(); itList != stripListEE.end(); itList++ ) {
1893 (*out_file_) <<
"STRIP_EE "<<dec<<(*itList)<<endl ;
1894 (*out_file_) << hex <<
"0x" <<
sliding_<<std::endl ;
1895 (*out_file_) <<
" 0" << std::endl ;
1896 (*out_file_)<<hex<<
"0x"<<threshold<<
" 0x"<<lut_strip<<std::endl ;
1906 towerListEB.sort() ;
1907 towerListEB.unique() ;
1908 cout<<
"Number of EB towers="<<dec<<towerListEB.size()<<endl ;
1910 (*out_file_) <<std::endl ;
1911 for (itList = towerListEB.begin(); itList != towerListEB.end(); itList++ ) {
1912 (*out_file_) <<
"TOWER_EB "<<dec<<(*itList)<<endl ;
1913 (*out_file_) <<
" 0\n 0\n" ;
1919 towerListEE.sort() ;
1920 towerListEE.unique() ;
1921 cout<<
"Number of EE towers="<<dec<<towerListEE.size()<<endl ;
1923 (*out_file_) <<std::endl ;
1924 for (itList = towerListEE.begin(); itList != towerListEE.end(); itList++ ) {
1925 (*out_file_) <<
"TOWER_EE "<<dec<<(*itList)<<endl ;
1926 if (newLUT) (*out_file_) <<
" 1\n" ;
1928 (*out_file_)<<hex<<
"0x"<<lut_tower<<std::endl ;
1939 tpgFactorEB->Write() ;
1941 tpgFactorEEPlus->Write() ;
1942 ICEEMinus->Write() ;
1943 tpgFactorEEMinus->Write() ;
1945 tpgFactor->Write() ;
1949 ntupleSpike->Write() ;
1955 using namespace edm;
1956 using namespace std;
1966 (*out_file_)<<
"PHYSICS_EB "<<dec<<eb.
rawId()<<std::endl ;
1971 (*out_file_) <<std::endl ;
1973 (*out_file_)<<
"PHYSICS_EE "<<dec<<ee.
rawId()<<std::endl ;
1976 <<-1<<
" "<<-1<<std::endl ;
1977 (*out_file_) <<std::endl ;
2016 double factor = 1024 * ratio * gainRatio * calibCoeff *
sin(theta) * (1 << (
sliding_ + shiftDet + 2)) ;
2018 mult = (int)(factor+0.5) ;
2019 for (shift = 0 ; shift<15 ; shift++) {
2020 if (mult>=128 && mult<256)
return true ;
2022 mult = (int)(factor+0.5) ;
2024 std::cout <<
"too bad we did not manage to calculate the factor for calib="<<calibCoeff<<endl;
2031 (*out_file_) <<
"COMMENT put your comments here"<<std::endl ;
2033 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2034 (*out_file_) <<
"COMMENT physics EB structure"<<std::endl ;
2035 (*out_file_) <<
"COMMENT"<<std::endl ;
2036 (*out_file_) <<
"COMMENT EtSaturation (GeV), ttf_threshold_Low (GeV), ttf_threshold_High (GeV)"<<std::endl ;
2037 (*out_file_) <<
"COMMENT FG_lowThreshold (GeV), FG_highThreshold (GeV), FG_lowRatio, FG_highRatio"<<std::endl ;
2039 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2040 (*out_file_) <<
"COMMENT"<<std::endl ;
2042 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2043 (*out_file_) <<
"COMMENT physics EE structure"<<std::endl ;
2044 (*out_file_) <<
"COMMENT"<<std::endl ;
2045 (*out_file_) <<
"COMMENT EtSaturation (GeV), ttf_threshold_Low (GeV), ttf_threshold_High (GeV)"<<std::endl ;
2046 (*out_file_) <<
"COMMENT FG_Threshold (GeV), dummy, dummy, dummy"<<std::endl ;
2047 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2048 (*out_file_) <<
"COMMENT"<<std::endl ;
2050 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2051 (*out_file_) <<
"COMMENT crystal structure (same for EB and EE)"<<std::endl ;
2052 (*out_file_) <<
"COMMENT"<<std::endl ;
2053 (*out_file_) <<
"COMMENT ped, mult, shift [gain12]"<<std::endl ;
2054 (*out_file_) <<
"COMMENT ped, mult, shift [gain6]"<<std::endl ;
2055 (*out_file_) <<
"COMMENT ped, mult, shift [gain1]"<<std::endl ;
2056 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2057 (*out_file_) <<
"COMMENT"<<std::endl ;
2059 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2060 (*out_file_) <<
"COMMENT strip EB structure"<<std::endl ;
2061 (*out_file_) <<
"COMMENT"<<std::endl ;
2062 (*out_file_) <<
"COMMENT sliding_window"<<std::endl ;
2063 (*out_file_) <<
"COMMENT weightGroupId"<<std::endl ;
2064 (*out_file_) <<
"COMMENT threshold_sfg lut_sfg"<<std::endl ;
2065 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2066 (*out_file_) <<
"COMMENT"<<std::endl ;
2068 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2069 (*out_file_) <<
"COMMENT strip EE structure"<<std::endl ;
2070 (*out_file_) <<
"COMMENT"<<std::endl ;
2071 (*out_file_) <<
"COMMENT sliding_window"<<std::endl ;
2072 (*out_file_) <<
"COMMENT weightGroupId"<<std::endl ;
2073 (*out_file_) <<
"COMMENT threshold_fg lut_fg"<<std::endl ;
2074 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2075 (*out_file_) <<
"COMMENT"<<std::endl ;
2077 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2078 (*out_file_) <<
"COMMENT tower EB structure"<<std::endl ;
2079 (*out_file_) <<
"COMMENT"<<std::endl ;
2080 (*out_file_) <<
"COMMENT LUTGroupId"<<std::endl ;
2081 (*out_file_) <<
"COMMENT FgGroupId"<<std::endl ;
2082 (*out_file_) <<
"COMMENT spike_killing_threshold"<<std::endl ;
2083 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2084 (*out_file_) <<
"COMMENT"<<std::endl ;
2086 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2087 (*out_file_) <<
"COMMENT tower EE structure"<<std::endl ;
2088 (*out_file_) <<
"COMMENT"<<std::endl ;
2089 (*out_file_) <<
"COMMENT LUTGroupId"<<std::endl ;
2090 (*out_file_) <<
"COMMENT tower_lut_fg"<<std::endl ;
2091 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2092 (*out_file_) <<
"COMMENT"<<std::endl ;
2094 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2095 (*out_file_) <<
"COMMENT Weight structure"<<std::endl ;
2096 (*out_file_) <<
"COMMENT"<<std::endl ;
2097 (*out_file_) <<
"COMMENT weightGroupId"<<std::endl ;
2098 (*out_file_) <<
"COMMENT w0, w1, w2, w3, w4"<<std::endl ;
2099 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2100 (*out_file_) <<
"COMMENT"<<std::endl ;
2102 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2103 (*out_file_) <<
"COMMENT lut structure"<<std::endl ;
2104 (*out_file_) <<
"COMMENT"<<std::endl ;
2105 (*out_file_) <<
"COMMENT LUTGroupId"<<std::endl ;
2106 (*out_file_) <<
"COMMENT LUT[1-1024]"<<std::endl ;
2107 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2108 (*out_file_) <<
"COMMENT"<<std::endl ;
2110 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2111 (*out_file_) <<
"COMMENT fg EB structure"<<std::endl ;
2112 (*out_file_) <<
"COMMENT"<<std::endl ;
2113 (*out_file_) <<
"COMMENT FgGroupId"<<std::endl ;
2114 (*out_file_) <<
"COMMENT el, eh, tl, th, lut_fg"<<std::endl ;
2115 (*out_file_) <<
"COMMENT ================================="<<std::endl ;
2116 (*out_file_) <<
"COMMENT"<<std::endl ;
2118 (*out_file_) <<std::endl ;
2125 unsigned int max = (
unsigned int)(
pow(2.,complement2)-1) ;
2126 if (weight>0) iweight=int((1<<6)*weight+0.5) ;
2127 else iweight= max - int(-weight*(1<<6)+0.5) +1 ;
2128 iweight = iweight &
max ;
2134 double weight = double(iweight)/
pow(2., 6.) ;
2136 if ( (iweight & (1<<(complement2-1))) != 0) weight = (double(iweight)-
pow(2., complement2))/
pow(2., 6.) ;
2140 #if (CMSSW_VERSION>=340)
2146 std::cout<<
"Computing Weights..."<<std::endl ;
2147 #if (CMSSW_VERSION>=340)
2148 double timeMax = shape.timeOfMax() - shape.timeOfThr() ;
2150 double timeMax = shape.computeTimeOfMaximum() - shape.computeT0() ;
2152 double max = shape(timeMax) ;
2159 sumf += shape(time)/
max ;
2160 sumf2 += shape(time)/max * shape(time)/
max ;
2161 for (
int subtime = 0 ; subtime<25 ; subtime++) histo->Fill(
float(
sample*25. + subtime)/25., shape(time+subtime)) ;
2163 double lambda = 1./(sumf2-sumf*sumf/
nSample_) ;
2164 double gamma = -lambda*sumf/
nSample_ ;
2169 weight[
sample] = lambda*shape(time)/max + gamma ;
2173 int * iweight =
new int[
nSample_] ;
2178 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) isumw += iweight[sample] ;
2180 isumw = (isumw & imax ) ;
2184 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) {
2187 ampl += weight[
sample]*shape(time) ;
2189 std::cout<<
"weight="<<weight[
sample]<<
" shape="<<shape(time)<<std::endl ;
2192 std::cout<<
"Weights: sum (weight*shape) = "<<ampl<<std::endl ;
2199 while (isumw != 0 && count<10) {
2201 unsigned int index = 0 ;
2204 std::cout<<
"Correcting for bias: adding 1"<<std::endl ;
2205 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) {
2206 int new_iweight = iweight[
sample]+1 ;
2208 if (fabs(new_weight-weight[sample])<min) {
2209 min = fabs(new_weight-weight[sample]) ;
2216 std::cout<<
"Correcting for bias: subtracting 1"<<std::endl ;
2217 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) {
2218 int new_iweight = iweight[
sample]-1 ;
2220 if (fabs(new_weight-weight[sample])<min) {
2221 min = fabs(new_weight-weight[sample]) ;
2228 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) isumw += iweight[sample] ;
2230 isumw = (isumw & imax ) ;
2231 std::cout<<
"Correcting weight number: "<<index<<
" sum weights = "<<isumw<<std::endl ;
2238 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) isumw += iweight[sample] ;
2240 isumw = (isumw & imax ) ;
2242 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) {
2247 ampl += new_weight*shape(time) ;
2248 std::cout<<
"weight unbiased after integer conversion="<<new_weight<<
" shape="<<shape(time)<<std::endl ;
2251 std::cout<<
"Weights: sum (weight*shape) = "<<ampl<<std::endl ;
2255 std::vector<unsigned int> theWeights ;
2256 for (
unsigned int sample = 0 ; sample<
nSample_ ; sample++) theWeights.push_back(iweight[sample]) ;
2284 for (
int i=0 ;
i<1024 ;
i++) {
2286 if (lut[
i]>0xff) lut[
i] = 0xff ;
2292 for (
int i=0 ;
i<1024 ;
i++) {
2294 if ((
i+1)%4 == 0 ) mylut++ ;
2302 func->SetParameters(LUT_stochastic, LUT_noise, LUT_constant) ;
2303 double norm = func->Integral(0., Et_sat) ;
2304 for (
int i=0 ;
i<1024 ;
i++) {
2305 double Et =
i*Et_sat/1024. ;
2306 lut[
i] = int(0xff*func->Integral(0., Et)/norm + 0.5) ;
2311 for (
int j=0 ;
j<1024 ;
j++) {
2312 double Et_GeV = Et_sat/1024*(
j+0.5) ;
2313 if (Et_GeV <= LUT_threshold) lut[
j] = 0 ;
2315 if (Et_GeV >= TTF_highThreshold) ttf = 3 ;
2316 if (Et_GeV >= TTF_lowThreshold && Et_GeV < TTF_highThreshold) ttf = 1 ;
2330 else std::cout<<
"getCoeff: "<<rawId<<
" not found in EcalIntercalibConstantMap"<<std::endl ;
2340 if (gainIter != gainMap.
end()) {
2345 else std::cout<<
"getCoeff: "<<rawId<<
" not found in EcalGainRatioMap"<<std::endl ;
2363 if (pedIter != pedMap.
end()) {
2365 coeff.
pedestals_[0] = int(aped.mean_x12 + 0.5) ;
2366 coeff.
pedestals_[1] = int(aped.mean_x6 + 0.5) ;
2367 coeff.
pedestals_[2] = int(aped.mean_x1 + 0.5) ;
2369 else std::cout<<
"getCoeff: "<<rawId<<
" not found in EcalPedestalsMap"<<std::endl ;
2379 map<EcalLogicID, MonPedestalsDat>::const_iterator it = pedMap.find(logicId);
2380 if (it != pedMap.end()) {
2387 <<
" not found in map<EcalLogicID, MonPedestalsDat>"<<std::endl ;
2391 unsigned int & lowThreshold,
unsigned int & highThreshold,
unsigned int &
lut)
2394 if (lowRatio>0x7f) lowRatio = 0x7f ;
2396 if (highRatio>0x7f) highRatio = 0x7f ;
2401 if (lowThreshold>0xff) lowThreshold = 0xff ;
2403 if (highThreshold>0xff) highThreshold = 0xff ;
2429 for (
int i=1 ;
i<3 ;
i++) {
2433 }
else base[
i] = 0 ;
2436 for (
int i=0 ;
i<3 ;
i++) {
2440 cout<<
"WARNING: base= "<<base[
i]<<
", "<<lin.
pedestal_[
i]<<
" for gainId[0-2]="<<
i<<
" ==> forcing at 0"<<endl ;
2451 gctphi = (ttphi+1)/4;
2452 if(ttphi<=2) gctphi=0;
2453 if(ttphi>=71) gctphi=0;
2459 if(tteta>0) gcteta = (tteta-1)/4 + 11;
2460 else if(tteta<0) gcteta = (tteta+1)/4 + 10;
2465 std::stringstream sdet ;
2467 if (tcc>36 && tcc<55) sdet<<
"EB-"<<tcc-36 ;
2468 else if (tcc>=55 && tcc<73) sdet<<
"EB+"<<tcc-54 ;
2469 else if (tcc<=36) sdet<<
"EE-" ;
2472 if (tcc<=36 || tcc>=73) {
2473 if (tcc>=73) tcc-=72 ;
2474 if (tcc==1 || tcc==18 || tcc==19 || tcc==36) sdet<<7 ;
2475 else if (tcc==2 || tcc==3 || tcc==20 || tcc==21) sdet<<8 ;
2476 else if (tcc==4 || tcc==5 || tcc==22 || tcc==23) sdet<<9 ;
2477 else if (tcc==6 || tcc==7 || tcc==24 || tcc==25) sdet<<1 ;
2478 else if (tcc==8 || tcc==9 || tcc==26 || tcc==27) sdet<<2 ;
2479 else if (tcc==10 || tcc==11 || tcc==28 || tcc==29) sdet<<3 ;
2480 else if (tcc==12 || tcc==13 || tcc==30 || tcc==31) sdet<<4 ;
2481 else if (tcc==14 || tcc==15 || tcc==32 || tcc==33) sdet<<5 ;
2482 else if (tcc==16 || tcc==17 || tcc==34 || tcc==35) sdet<<6 ;
2489 std::stringstream crate ;
2494 if (tcc>=40 && tcc<=42) {crate<<
"02d" ; slot = 5 + (tcc-40)*6 ;}
2495 if (tcc>=43 && tcc<=45) {crate<<
"03d" ; slot = 5 + (tcc-43)*6 ;}
2496 if (tcc>=37 && tcc<=39) {crate<<
"04d" ; slot = 5 + (tcc-37)*6 ;}
2497 if (tcc>=52 && tcc<=54) {crate<<
"06d" ; slot = 5 + (tcc-52)*6 ;}
2498 if (tcc>=46 && tcc<=48) {crate<<
"07d" ; slot = 5 + (tcc-46)*6 ;}
2499 if (tcc>=49 && tcc<=51) {crate<<
"08d" ; slot = 5 + (tcc-49)*6 ;}
2500 if (tcc>=58 && tcc<=60) {crate<<
"02h" ; slot = 5 + (tcc-58)*6 ;}
2501 if (tcc>=61 && tcc<=63) {crate<<
"03h" ; slot = 5 + (tcc-61)*6 ;}
2502 if (tcc>=55 && tcc<=57) {crate<<
"04h" ; slot = 5 + (tcc-55)*6 ;}
2503 if (tcc>=70 && tcc<=72) {crate<<
"06h" ; slot = 5 + (tcc-70)*6 ;}
2504 if (tcc>=64 && tcc<=66) {crate<<
"07h" ; slot = 5 + (tcc-64)*6 ;}
2505 if (tcc>=67 && tcc<=69) {crate<<
"08h" ; slot = 5 + (tcc-67)*6 ;}
2507 if (tcc>=76 && tcc<=81) {
2509 if (tcc%2==0) slot = 2 + (tcc-76)*3 ;
2510 else slot = 4 + (tcc-77)*3 ;
2512 if (tcc>=94 && tcc<=99) {
2514 if (tcc%2==0) slot = 3 + (tcc-94)*3 ;
2515 else slot = 5 + (tcc-95)*3 ;
2518 if (tcc>=22 && tcc<=27) {
2520 if (tcc%2==0) slot = 2 + (tcc-22)*3 ;
2521 else slot = 4 + (tcc-23)*3 ;
2523 if (tcc>=4 && tcc<=9) {
2525 if (tcc%2==0) slot = 3 + (tcc-4)*3 ;
2526 else slot = 5 + (tcc-5)*3 ;
2529 if (tcc>=82 && tcc<=87) {
2531 if (tcc%2==0) slot = 2 + (tcc-82)*3 ;
2532 else slot = 4 + (tcc-83)*3 ;
2534 if (tcc>=100 && tcc<=105) {
2536 if (tcc%2==0) slot = 3 + (tcc-100)*3 ;
2537 else slot = 5 + (tcc-101)*3 ;
2540 if (tcc>=28 && tcc<=33) {
2542 if (tcc%2==0) slot = 2 + (tcc-28)*3 ;
2543 else slot = 4 + (tcc-29)*3 ;
2545 if (tcc>=10 && tcc<=15) {
2547 if (tcc%2==0) slot = 3 + (tcc-10)*3 ;
2548 else slot = 5 + (tcc-11)*3 ;
2551 if (tcc==34) {crate<<
"04l" ; slot = 2 ;}
2552 if (tcc==16) {crate<<
"04l" ; slot = 3 ;}
2553 if (tcc==35) {crate<<
"04l" ; slot = 4 ;}
2554 if (tcc==17) {crate<<
"04l" ; slot = 5 ;}
2555 if (tcc==36) {crate<<
"04l" ; slot = 8 ;}
2556 if (tcc==18) {crate<<
"04l" ; slot = 9 ;}
2557 if (tcc==19) {crate<<
"04l" ; slot = 10 ;}
2558 if (tcc==1) {crate<<
"04l" ; slot = 11 ;}
2559 if (tcc==20) {crate<<
"04l" ; slot = 14 ;}
2560 if (tcc==2) {crate<<
"04l" ; slot = 15 ;}
2561 if (tcc==21) {crate<<
"04l" ; slot = 16 ;}
2562 if (tcc==3) {crate<<
"04l" ; slot = 17 ;}
2564 if (tcc==88) {crate<<
"06l" ; slot = 2 ;}
2565 if (tcc==106) {crate<<
"06l" ; slot = 3 ;}
2566 if (tcc==89) {crate<<
"06l" ; slot = 4 ;}
2567 if (tcc==107) {crate<<
"06l" ; slot = 5 ;}
2568 if (tcc==90) {crate<<
"06l" ; slot = 8 ;}
2569 if (tcc==108) {crate<<
"06l" ; slot = 9 ;}
2570 if (tcc==73) {crate<<
"06l" ; slot = 10 ;}
2571 if (tcc==91) {crate<<
"06l" ; slot = 11 ;}
2572 if (tcc==74) {crate<<
"06l" ; slot = 14 ;}
2573 if (tcc==92) {crate<<
"06l" ; slot = 15 ;}
2574 if (tcc==75) {crate<<
"06l" ; slot = 16 ;}
2575 if (tcc==93) {crate<<
"06l" ; slot = 17 ;}
2577 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_
void setThreshLow(float x)
edm::ESHandle< EcalTrigTowerConstituentsMap > eTTmap_
int xtalId() const
get the channel id
virtual const CaloSimParameters & simParameters(const DetId &id) const
return the sim parameters relative to the right subdet
void setLUTGroupId(int x)
int stripId() const
get the tower id
void setFGhighratio(float x)
const self & getMap() const
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)
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
bool weight_unbias_recovery_
void setFGlowthresh(float x)
int towerId() const
get the tower id
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_
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
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_
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)
void getCoeff(coeffStruc &coeff, const EcalIntercalibConstantMap &calibMap, uint rawId)
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.
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)
Geom::Theta< T > theta() const
uint32_t rawId() const
get the raw id
double timePhase() const
the adjustment you need to apply to get the signal where you want it
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_
const T & max(const T &a, const T &b)
EcalPedestalsMap::const_iterator EcalPedestalsMapIterator
void setLutFgr(unsigned int mean)
int ietaAbs() const
get the absolute value of the tower ieta
const EcalElectronicsMapping * theMapping_
void computeLUT(int *lut, std::string det="EB")
bool useTransverseEnergy_
EcalTPGParamBuilder(edm::ParameterSet const &pSet)
void fetchDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *iov)
void setLUTValue(int i, int x)
EcalLogicID getEcalLogicID(std::string name, int id1=EcalLogicID::NULLID, int id2=EcalLogicID::NULLID, int id3=EcalLogicID::NULLID, std::string mapsTo="")
virtual void analyze(const edm::Event &evt, const edm::EventSetup &evtSetup)
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)
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)
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
T const * product() const
int DCCid(const EBDetId &id) const
returns the DCC of an EBDetId
float gain12Over6() const
float getPedMeanG1() const
float getPedMeanG6() const
unsigned tccId(const DetId &)
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)
static const int SMCRYSTALMODE
void setWeightGroupId(int x)
unsigned int FG_lut_strip_EE_
int getEtaSlice(int tccId, int towerInTCC)
double FG_highThreshold_EB_
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)
tuple size
Write out results.
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)
int uncodeWeight(double weight, int complement2=7)