20 enum {NTCC = 108, NTower = 28, NStrip = 5, NXtal = 5};
33 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
39 int EEcount[2] = {0, 0};
41 std::string mappingFile =
"Geometry/EcalMapping/data/EEMap.txt";
44 std::cout <<
"EcalTPGFineGrainStripEE File EEMap.txt not found" << std::endl;
48 uint32_t rawEE[NTCC][NTower][NStrip][NXtal];
49 int NbrawEE[NTCC][NTower][NStrip];
50 for(
int TCC = 0; TCC < NTCC; TCC++)
51 for(
int TT = 0; TT < NTower; TT++)
52 for(
int ST = 0; ST < NStrip; ST++)
53 NbrawEE[TCC][TT][ST] = 0;
57 int dccid, towerid, pseudostrip_in_SC, xtal_in_pseudostrip;
58 int tccid, tower, pseudostrip_in_TCC, pseudostrip_in_TT;
59 f >> ix >> iy >> iz >> CL >> dccid >> towerid >> pseudostrip_in_SC >> xtal_in_pseudostrip
60 >> tccid >> tower >> pseudostrip_in_TCC >> pseudostrip_in_TT ;
63 uint32_t rawId = detid.denseIndex();
64 if(tccid > NTCC || tower > NTower || pseudostrip_in_TT > NStrip || xtal_in_pseudostrip > NXtal){
68 rawEE[tccid - 1][tower - 1][pseudostrip_in_TT - 1][xtal_in_pseudostrip - 1] = rawId;
69 NbrawEE[tccid - 1][tower - 1][pseudostrip_in_TT - 1]++;
77 auto iov = iovs.front();
79 unsigned int run = std::get<0>(iov);
80 double max1=1.0, max2=1.0;
86 for(itSt = stripMap.begin(); itSt != stripMap.end(); ++itSt) {
90 int strip = itSt->first/8;
91 int pseudostrip = strip & 0x7;
93 int tt = strip & 0x7F;
95 int tccid = strip & 0x7F;
96 int NbXtalInStrip = NbrawEE[tccid - 1][tt - 1][pseudostrip - 1];
101 for(
int Xtal = 0; Xtal < NbXtalInStrip; Xtal++) {
102 uint32_t rawId = rawEE[tccid - 1][tt - 1][pseudostrip - 1][Xtal];
107 int iz = detid.
zside();
111 endc_thresh_m->Fill(x + 0.5, y + 0.5, item.
threshold);
112 endc_lut_m->Fill(x + 0.5, y + 0.5, item.
lut);
122 endc_thresh_p->Fill(x + 0.5, y + 0.5, item.
threshold);
123 endc_lut_p->Fill(x + 0.5, y + 0.5, item.
lut);
142 gStyle->SetPalette(1);
143 gStyle->SetOptStat(0);
144 const Int_t NRGBs = 5;
145 const Int_t NCont = 255;
147 Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
148 Double_t
red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
149 Double_t
green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
150 Double_t
blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
151 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
152 gStyle->SetNumberContours(NCont);
156 TCanvas
canvas(
"c",
"c", w, h);
162 t1.SetTextSize(0.04);
163 t1.DrawLatex(0.5, 0.96, Form(
"Ecal TPG Fine Grain StripEE, IOV %i", run));
166 float xmi[4] = {0.0, 0.5, 0.0, 0.5};
167 float xma[4] = {0.5, 1.0, 0.5, 1.0};
169 float ymi[4] = {0.47, 0.47, 0.0, 0.0};
170 float yma[4] = {0.94, 0.94, 0.47, 0.47};
171 TPad** pad =
new TPad*;
173 pad[
obj] =
new TPad(Form(
"p_%i",
obj),Form(
"p_%i",
obj), xmi[
obj], ymi[obj], xma[obj], yma[obj]);
180 DrawEE(endc_thresh_m, 0., max1);
181 t1.DrawLatex(0.15, 0.92, Form(
"%i crystals", EEcount[0]));
184 DrawEE(endc_thresh_p, 0., max1);
185 t1.DrawLatex(0.15, 0.92, Form(
"%i crystals", EEcount[1]));
189 DrawEE(endc_lut_m, 0., max2);
190 t1.DrawLatex(0.15, 0.92, Form(
"%i crystals", EEcount[0]));
193 DrawEE(endc_lut_p, 0., max2);
194 t1.DrawLatex(0.15, 0.92, Form(
"%i crystals", EEcount[1]));
198 canvas.SaveAs(ImageName.c_str());
203 delete endc_thresh_p;
204 delete endc_thresh_m;
static EEDetId detIdFromDenseIndex(uint32_t din)
std::map< uint32_t, EcalTPGFineGrainStripEE::Item > EcalTPGFineGrainStripEEMap
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)
void DrawEE(TH2F *endc, float min, float max)
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
std::map< uint32_t, EcalTPGFineGrainStripEE::Item >::const_iterator EcalTPGFineGrainStripEEMapIterator
virtual bool fill(const std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs)=0
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)
void setSingleIov(bool flag)