File indexing completed on 2026-04-21 07:51:39
0001 #include "MultiCanvas.h"
0002
0003 ClassImp(MultiCanvas);
0004
0005
0006
0007
0008 bool MultiCanvas::Initialize(int opt){
0009
0010
0011
0012
0013 if (opt == 1){
0014 if (init){
0015 std::cout << "1D version of MultiCanvas already initialized for " << addName.Data() << std::endl;
0016 return init;
0017 }
0018
0019 textSize = 30;
0020
0021
0022
0023
0024 if ( detType == DetConf::Type::SingleTile){
0025 canvasMulti = new TCanvas(Form("canvasLayer%s",addName.Data()),"",0,0,620,600);
0026 DefaultCanvasSettings( canvasMulti,0.12, 0.03, 0.03, 0.1);
0027 legPlace_X[0] = 0.95;
0028 legPlace_Y[0] = 0.95;
0029 relTextSize[0] = {30./620};
0030 init = true;
0031
0032
0033 } else if ( detType == DetConf::Type::Single2MH){
0034 CreateCanvasAndPadsFor2PannelTBPlot(textSize, 0.03, addName);
0035 init = true;
0036
0037
0038 } else if ( detType == DetConf::Type::Single2MV){
0039 init = false;
0040 std::cout << "Setup-1d: this option hasn't been implemented yet!" << std::endl;
0041
0042
0043 } else if (detType == DetConf::Type::Single4M){
0044 init = false;
0045 std::cout << "Setup-1d: this option hasn't been implemented yet!" << std::endl;
0046
0047
0048 } else if (detType == DetConf::Type::Single8M){
0049 CreateCanvasAndPadsFor8PannelTBPlot(textSize, 0.03, addName);
0050 maxPads = 8;
0051 std::cout << canvasMulti << std::endl;
0052 init = true;
0053
0054
0055 } else if ( detType == DetConf::Type::Dual8M){
0056 CreateCanvasAndPadsForDualModTBPlot(textSize, 0.03, addName);
0057 maxPads = 16;
0058 init = true;
0059
0060 } else if ( detType == DetConf::Type::LargeTB){
0061 init = false;
0062 std::cout << "Setup-1d: this option hasn't been implemented yet!" << std::endl;
0063
0064 } else if ( detType == DetConf::Type::Asic){
0065 CreateCanvasAndPadsForAsicLFHCalTBPlot( textSize, 0.045, addName);
0066 maxPads = 64;
0067 init = true;
0068 }
0069
0070 if (init)
0071 return true;
0072 else
0073 return false;
0074
0075
0076
0077
0078
0079 } else if (opt == 2){
0080 if (init){
0081 std::cout << "2D version of MultiCanvas already initialized for " << addName.Data() << std::endl;
0082 return init;
0083 }
0084
0085 textSize = 30;
0086
0087
0088
0089
0090 if ( detType == DetConf::Type::SingleTile){
0091 canvasMulti = new TCanvas(Form("canvasLayer%sProf",addName.Data()),"",0,0,620,600);
0092 DefaultCanvasSettings( canvasMulti,0.138, 0.08, 0.03, 0.1);
0093 legPlace_X[0] = 0.175;
0094 legPlace_Y[0] = 0.95;
0095 relTextSize[0] = 30./620;
0096 maxPads = 1;
0097 init = true;
0098
0099 } else if ( detType == DetConf::Type::Single4M){
0100 init = false;
0101 std::cout << "Setup-2d: this option hasn't been implemented yet!" << std::endl;
0102
0103
0104 } else if ( detType == DetConf::Type::Single2MH){
0105 CreateCanvasAndPadsFor2PannelTBPlot( textSize, 0.075, addName+"Prof", false);
0106 maxPads = 2;
0107 init = true;
0108
0109
0110 } else if ( detType == DetConf::Type::Single2MV){
0111 init = false;
0112 std::cout << "Setup-2d: this option hasn't been implemented yet!" << std::endl;
0113
0114
0115 } else if (detType == DetConf::Type::Single8M){
0116 CreateCanvasAndPadsFor8PannelTBPlot(textSize, 0.045, addName+"Prof", false);
0117 maxPads = 8;
0118 init = true;
0119
0120
0121 } else if ( detType == DetConf::Type::Dual8M){
0122 CreateCanvasAndPadsForDualModTBPlot(textSize, 0.045, addName+"Prof", true);
0123 maxPads = 16;
0124 init = true;
0125
0126
0127 } else if ( detType == DetConf::Type::LargeTB){
0128 init = false;
0129 std::cout << "Setup-2d: this option hasn't been implemented yet!" << std::endl;
0130
0131
0132 } else if ( detType == DetConf::Type::Asic){
0133 CreateCanvasAndPadsForAsicLFHCalTBPlot( textSize, 0.045, addName+"Prof", true);
0134 maxPads = 64;
0135 init = true;
0136 }
0137
0138 if (init)
0139 return true;
0140 else
0141 return false;
0142
0143 return true;
0144 } else {
0145 std::cout << "This option isn't defined please check MultiCanvas::Initialize() for correct setup options!" << std::endl;
0146 return false;
0147 }
0148 }
0149
0150
0151
0152 void MultiCanvas::ReturnCorrectValuesForCanvasScaling( Int_t sizeX,
0153 Int_t sizeY,
0154 Int_t nCols,
0155 Int_t nRows,
0156 Double_t leftMargin,
0157 Double_t rightMargin,
0158 Double_t upperMargin,
0159 Double_t lowerMargin,
0160 Double_t* arrayBoundariesX,
0161 Double_t* arrayBoundariesY,
0162 Double_t* relativeMarginsX,
0163 Double_t* relativeMarginsY,
0164 int verbose){
0165 Int_t realsizeX = sizeX- (Int_t)(sizeX*leftMargin)- (Int_t)(sizeX*rightMargin);
0166 Int_t realsizeY = sizeY- (Int_t)(sizeY*upperMargin)- (Int_t)(sizeY*lowerMargin);
0167
0168 Int_t nPixelsLeftColumn = (Int_t)(sizeX*leftMargin);
0169 Int_t nPixelsRightColumn = (Int_t)(sizeX*rightMargin);
0170 Int_t nPixelsUpperColumn = (Int_t)(sizeY*upperMargin);
0171 Int_t nPixelsLowerColumn = (Int_t)(sizeY*lowerMargin);
0172
0173 Int_t nPixelsSinglePlotX = (Int_t) (realsizeX/nCols);
0174 Int_t nPixelsSinglePlotY = (Int_t) (realsizeY/nRows);
0175 if(verbose > 0){
0176 std::cout << "Setup multi panel canvas"<< std::endl;
0177 std::cout << "X: "<< realsizeX << "\t" << nPixelsSinglePlotX << std::endl;
0178 std::cout << "Y: "<< realsizeY << "\t" << nPixelsSinglePlotY << std::endl;
0179 std::cout << "columns:"<< nPixelsLeftColumn << "\t" << nPixelsRightColumn << "\t" << nPixelsLowerColumn << "\t" << nPixelsUpperColumn << std::endl;
0180 }
0181 Int_t pixel = 0;
0182 if(verbose > 1)std::cout << "boundaries X" << std::endl;
0183 for (Int_t i = 0; i < nCols+1; i++){
0184 if (i == 0){
0185 arrayBoundariesX[i] = 0.;
0186 pixel = pixel+nPixelsLeftColumn+nPixelsSinglePlotX;
0187 } else if (i == nCols){
0188 arrayBoundariesX[i] = 1.;
0189 pixel = pixel+nPixelsRightColumn;
0190 } else {
0191 arrayBoundariesX[i] = (Double_t)pixel/sizeX;
0192 pixel = pixel+nPixelsSinglePlotX;
0193 }
0194 if(verbose > 1)std::cout << "arrayBoundariesX: " << i << "\t" << arrayBoundariesX[i] << "\t" << pixel<<std::endl;
0195 }
0196
0197 if(verbose > 1)std::cout << "boundaries Y" << std::endl;
0198 pixel = sizeY;
0199 for (Int_t i = 0; i < nRows+1; i++){
0200 if (i == 0){
0201 arrayBoundariesY[i] = 1.;
0202 pixel = pixel-nPixelsUpperColumn-nPixelsSinglePlotY;
0203 } else if (i == nRows){
0204 arrayBoundariesY[i] = 0.;
0205 pixel = pixel-nPixelsLowerColumn;
0206 } else {
0207 arrayBoundariesY[i] = (Double_t)pixel/sizeY;
0208 pixel = pixel-nPixelsSinglePlotY;
0209 }
0210 if(verbose > 1)std::cout << i << "\t" << arrayBoundariesY[i] <<"\t" << pixel<<std::endl;
0211 }
0212
0213 relativeMarginsX[0] = (Double_t)nPixelsLeftColumn/(nPixelsLeftColumn+nPixelsSinglePlotX);
0214 relativeMarginsX[1] = 0;
0215 relativeMarginsX[2] = (Double_t)nPixelsRightColumn/(nPixelsRightColumn+nPixelsSinglePlotX);;
0216
0217 relativeMarginsY[0] = (Double_t)nPixelsUpperColumn/(nPixelsUpperColumn+nPixelsSinglePlotY);
0218 relativeMarginsY[1] = 0;
0219 relativeMarginsY[2] = (Double_t)nPixelsLowerColumn/(nPixelsLowerColumn+nPixelsSinglePlotY);;
0220
0221 return;
0222 }
0223
0224
0225 void MultiCanvas::ReturnCorrectValuesTextSize( TPad * pad,
0226 Double_t &textsizeLabels,
0227 Double_t &textsizeFac,
0228 Int_t textSizeLabelsPixel,
0229 Double_t dummyWUP){
0230 if(dummyWUP){}
0231
0232 textsizeLabels = 0;
0233 textsizeFac = 0;
0234 if (pad->XtoPixel(pad->GetX2()) < pad->YtoPixel(pad->GetY1())){
0235 textsizeLabels = (Double_t)textSizeLabelsPixel/pad->XtoPixel(pad->GetX2()) ;
0236 textsizeFac = (Double_t)1./pad->XtoPixel(pad->GetX2()) ;
0237 } else {
0238 textsizeLabels = (Double_t)textSizeLabelsPixel/pad->YtoPixel(pad->GetY1());
0239 textsizeFac = (Double_t)1./pad->YtoPixel(pad->GetY1());
0240 }
0241 std::cout << textsizeLabels << std::endl;
0242 std::cout << textsizeFac << std::endl;
0243
0244 return;
0245
0246 }
0247
0248
0249
0250
0251 void MultiCanvas::CreateCanvasAndPadsFor8PannelTBPlot(Int_t textSizePixel,
0252 Double_t marginLeft,
0253 TString add ,
0254 bool rightCorner,
0255 int debug ){
0256 Double_t arrayBoundX[5];
0257 Double_t arrayBoundY[3];
0258 Double_t relativeMarginsX[3];
0259 Double_t relativeMarginsY[3];
0260 ReturnCorrectValuesForCanvasScaling(2200,1200, 4, 2,marginLeft, 0.005, 0.005,0.05,arrayBoundX,arrayBoundY,relativeMarginsX,relativeMarginsY, debug);
0261
0262
0263
0264 canvasMulti = new TCanvas(Form("canvas8Panel%s", add.Data()),"",0,0,2200,1200);
0265 canvasMulti->cd();
0266
0267
0268
0269
0270
0271
0272
0273
0274
0275
0276
0277 padMulti[0] = new TPad(Form("pad8Panel%s_0", add.Data()), "", arrayBoundX[0], arrayBoundY[2], arrayBoundX[1], arrayBoundY[1],-1, -1, -2);
0278 padMulti[1] = new TPad(Form("pad8Panel%s_1", add.Data()), "", arrayBoundX[1], arrayBoundY[2], arrayBoundX[2], arrayBoundY[1],-1, -1, -2);
0279 padMulti[2] = new TPad(Form("pad8Panel%s_2", add.Data()), "", arrayBoundX[2], arrayBoundY[2], arrayBoundX[3], arrayBoundY[1],-1, -1, -2);
0280 padMulti[3] = new TPad(Form("pad8Panel%s_3", add.Data()), "", arrayBoundX[3], arrayBoundY[2], arrayBoundX[4], arrayBoundY[1],-1, -1, -2);
0281 padMulti[4] = new TPad(Form("pad8Panel%s_4", add.Data()), "", arrayBoundX[0], arrayBoundY[1],arrayBoundX[1], arrayBoundY[0],-1, -1, -2);
0282 padMulti[5] = new TPad(Form("pad8Panel%s_5", add.Data()), "", arrayBoundX[1], arrayBoundY[1],arrayBoundX[2], arrayBoundY[0],-1, -1, -2);
0283 padMulti[6] = new TPad(Form("pad8Panel%s_6", add.Data()), "", arrayBoundX[2], arrayBoundY[1],arrayBoundX[3], arrayBoundY[0],-1, -1, -2);
0284 padMulti[7] = new TPad(Form("pad8Panel%s_7", add.Data()), "", arrayBoundX[3], arrayBoundY[1],arrayBoundX[4], arrayBoundY[0],-1, -1, -2);
0285
0286 DefaultPadSettings( padMulti[4], relativeMarginsX[0], relativeMarginsX[1], relativeMarginsY[0], relativeMarginsY[1]);
0287 DefaultPadSettings( padMulti[5], relativeMarginsX[1], relativeMarginsX[1], relativeMarginsY[0], relativeMarginsY[1]);
0288 DefaultPadSettings( padMulti[6], relativeMarginsX[1], relativeMarginsX[1], relativeMarginsY[0], relativeMarginsY[1]);
0289 DefaultPadSettings( padMulti[7], relativeMarginsX[1], relativeMarginsX[2], relativeMarginsY[0], relativeMarginsY[1]);
0290 DefaultPadSettings( padMulti[0], relativeMarginsX[0], relativeMarginsX[1], relativeMarginsY[1], relativeMarginsY[2]);
0291 DefaultPadSettings( padMulti[1], relativeMarginsX[1], relativeMarginsX[1], relativeMarginsY[1], relativeMarginsY[2]);
0292 DefaultPadSettings( padMulti[2], relativeMarginsX[1], relativeMarginsX[1], relativeMarginsY[1], relativeMarginsY[2]);
0293 DefaultPadSettings( padMulti[3], relativeMarginsX[1], relativeMarginsX[2], relativeMarginsY[1], relativeMarginsY[2]);
0294
0295 legPlace_Y[0] = 1-relativeMarginsY[1];
0296 legPlace_Y[1] = 1-relativeMarginsY[1];
0297 legPlace_Y[2] = 1-relativeMarginsY[1];
0298 legPlace_Y[3] = 1-relativeMarginsY[1];
0299 legPlace_Y[4] = 1-relativeMarginsY[0];
0300 legPlace_Y[5] = 1-relativeMarginsY[0];
0301 legPlace_Y[6] = 1-relativeMarginsY[0];
0302 legPlace_Y[7] = 1-relativeMarginsY[0];
0303 if (rightCorner){
0304 legPlace_X[0] = 1-relativeMarginsX[1];
0305 legPlace_X[1] = 1-relativeMarginsX[1];
0306 legPlace_X[2] = 1-relativeMarginsX[1];
0307 legPlace_X[3] = 1-relativeMarginsX[2];
0308 legPlace_X[4] = 1-relativeMarginsX[1];
0309 legPlace_X[5] = 1-relativeMarginsX[1];
0310 legPlace_X[6] = 1-relativeMarginsX[1];
0311 legPlace_X[7] = 1-relativeMarginsX[2];
0312 } else {
0313 legPlace_X[0] = relativeMarginsX[0];
0314 legPlace_X[1] = relativeMarginsX[1];
0315 legPlace_X[2] = relativeMarginsX[1];
0316 legPlace_X[3] = relativeMarginsX[1];
0317 legPlace_X[4] = relativeMarginsX[0];
0318 legPlace_X[5] = relativeMarginsX[1];
0319 legPlace_X[6] = relativeMarginsX[1];
0320 legPlace_X[7] = relativeMarginsX[1];
0321 }
0322
0323 for (Int_t p = 0; p < 8; p++){
0324 if (padMulti[p]->XtoPixel(padMulti[p]->GetX2()) < padMulti[p]->YtoPixel(padMulti[p]->GetY1())){
0325 relTextSize[p] = (Double_t)textSizePixel/padMulti[p]->XtoPixel(padMulti[p]->GetX2()) ;
0326 } else {
0327 relTextSize[p] = (Double_t)textSizePixel/padMulti[p]->YtoPixel(padMulti[p]->GetY1());
0328 }
0329 if(debug > 1)std::cout << p << "\t" << legPlace_X[p]<< "\t" << legPlace_Y[p] << "\t" << relTextSize[p] << std::endl;
0330 }
0331 return;
0332 }
0333
0334
0335
0336
0337 void MultiCanvas::CreateCanvasAndPadsFor2PannelTBPlot( Int_t textSizePixel,
0338 Double_t marginLeft,
0339 TString add,
0340 bool rightCorner,
0341 int debug
0342 ){
0343 Double_t arrayBoundX[3];
0344 Double_t arrayBoundY[2];
0345 Double_t relativeMarginsX[3];
0346 Double_t relativeMarginsY[3];
0347 ReturnCorrectValuesForCanvasScaling(1200,600, 2, 1,marginLeft, 0.005, 0.015,0.1,arrayBoundX,arrayBoundY,relativeMarginsX,relativeMarginsY, 2);
0348
0349 canvasMulti = new TCanvas(Form("canvas2Panel%s", add.Data()),"",0,0,1200,600);
0350 canvasMulti->cd();
0351
0352
0353
0354
0355
0356
0357
0358
0359
0360
0361
0362 std::cout << "0: " << arrayBoundX[0] << "\t" << arrayBoundY[0] << "\t" << arrayBoundX[1] << "\t" << arrayBoundY[1] << std::endl;
0363 std::cout << "1: " << arrayBoundX[1] << "\t" << arrayBoundY[0] << "\t" << arrayBoundX[2] << "\t" << arrayBoundY[1] << std::endl;
0364
0365 padMulti[0] = new TPad(Form("pad2Panel%s_0", add.Data()), "", arrayBoundX[0], arrayBoundY[1], arrayBoundX[1], arrayBoundY[0],-1, -1, -2);
0366 padMulti[1] = new TPad(Form("pad2Panel%s_1", add.Data()), "", arrayBoundX[1], arrayBoundY[1], arrayBoundX[2], arrayBoundY[0],-1, -1, -2);
0367
0368
0369 DefaultPadSettings( padMulti[0], relativeMarginsX[0], relativeMarginsX[1], relativeMarginsY[0], relativeMarginsY[2]);
0370 DefaultPadSettings( padMulti[1], relativeMarginsX[1], relativeMarginsX[2], relativeMarginsY[0], relativeMarginsY[2]);
0371
0372 legPlace_Y[0] = 1-relativeMarginsY[2];
0373 legPlace_Y[1] = 1-relativeMarginsY[2];
0374 if (rightCorner){
0375 legPlace_X[0] = 1-relativeMarginsX[1];
0376 legPlace_X[1] = 1-relativeMarginsX[2];
0377 } else {
0378 legPlace_X[0] = relativeMarginsX[0];
0379 legPlace_X[1] = relativeMarginsX[1];
0380 }
0381
0382 for (Int_t p = 0; p < 2; p++){
0383 if (padMulti[p]->XtoPixel(padMulti[p]->GetX2()) < padMulti[p]->YtoPixel(padMulti[p]->GetY1())){
0384 relTextSize[p] = (Double_t)textSizePixel/padMulti[p]->XtoPixel(padMulti[p]->GetX2()) ;
0385 } else {
0386 relTextSize[p] = (Double_t)textSizePixel/padMulti[p]->YtoPixel(padMulti[p]->GetY1());
0387 }
0388
0389 std::cout << p << "\t" << legPlace_X[p]<< "\t" << legPlace_Y[p] << "\t" << relTextSize[p] << std::endl;
0390 }
0391 return;
0392 }
0393
0394
0395
0396
0397 void MultiCanvas::CreateCanvasAndPadsForDualModTBPlot(Int_t textSizePixel,
0398 Double_t marginLeft,
0399 TString add,
0400 bool rightCorner,
0401 int debug
0402 ){
0403 Double_t arrayBoundX[5];
0404 Double_t arrayBoundY[5];
0405 Double_t relativeMarginsX[3];
0406 Double_t relativeMarginsY[3];
0407 ReturnCorrectValuesForCanvasScaling(2200,2200, 4, 4,marginLeft, 0.005, 0.005,marginLeft,arrayBoundX,arrayBoundY,relativeMarginsX,relativeMarginsY, debug);
0408
0409 canvasMulti = new TCanvas(Form("canvas4x4Panel%s", add.Data()),"",0,0,2200,2200);
0410 canvasMulti->cd();
0411
0412
0413
0414
0415
0416
0417
0418
0419
0420
0421
0422
0423
0424
0425
0426 padMulti[0] = new TPad(Form("pad4x4Panel%s_0", add.Data()), "", arrayBoundX[0], arrayBoundY[4], arrayBoundX[1], arrayBoundY[3],-1, -1, -2);
0427 padMulti[1] = new TPad(Form("pad4x4Panel%s_1", add.Data()), "", arrayBoundX[1], arrayBoundY[4], arrayBoundX[2], arrayBoundY[3],-1, -1, -2);
0428 padMulti[2] = new TPad(Form("pad4x4Panel%s_2", add.Data()), "", arrayBoundX[2], arrayBoundY[4], arrayBoundX[3], arrayBoundY[3],-1, -1, -2);
0429 padMulti[3] = new TPad(Form("pad4x4Panel%s_3", add.Data()), "", arrayBoundX[3], arrayBoundY[4], arrayBoundX[4], arrayBoundY[3],-1, -1, -2);
0430 padMulti[4] = new TPad(Form("pad4x4Panel%s_4", add.Data()), "", arrayBoundX[0], arrayBoundY[3],arrayBoundX[1], arrayBoundY[2],-1, -1, -2);
0431 padMulti[5] = new TPad(Form("pad4x4Panel%s_5", add.Data()), "", arrayBoundX[1], arrayBoundY[3],arrayBoundX[2], arrayBoundY[2],-1, -1, -2);
0432 padMulti[6] = new TPad(Form("pad4x4Panel%s_6", add.Data()), "", arrayBoundX[2], arrayBoundY[3],arrayBoundX[3], arrayBoundY[2],-1, -1, -2);
0433 padMulti[7] = new TPad(Form("pad4x4Panel%s_7", add.Data()), "", arrayBoundX[3], arrayBoundY[3],arrayBoundX[4], arrayBoundY[2],-1, -1, -2);
0434 padMulti[8] = new TPad(Form("pad4x4Panel%s_8", add.Data()), "", arrayBoundX[0], arrayBoundY[2], arrayBoundX[1], arrayBoundY[1],-1, -1, -2);
0435 padMulti[9] = new TPad(Form("pad4x4Panel%s_9", add.Data()), "", arrayBoundX[1], arrayBoundY[2], arrayBoundX[2], arrayBoundY[1],-1, -1, -2);
0436 padMulti[10] = new TPad(Form("pad4x4Panel%s_10", add.Data()), "", arrayBoundX[2], arrayBoundY[2], arrayBoundX[3], arrayBoundY[1],-1, -1, -2);
0437 padMulti[11] = new TPad(Form("pad4x4Panel%s_11", add.Data()), "", arrayBoundX[3], arrayBoundY[2], arrayBoundX[4], arrayBoundY[1],-1, -1, -2);
0438 padMulti[12] = new TPad(Form("pad4x4Panel%s_12", add.Data()), "", arrayBoundX[0], arrayBoundY[1],arrayBoundX[1], arrayBoundY[0],-1, -1, -2);
0439 padMulti[13] = new TPad(Form("pad4x4Panel%s_13", add.Data()), "", arrayBoundX[1], arrayBoundY[1],arrayBoundX[2], arrayBoundY[0],-1, -1, -2);
0440 padMulti[14] = new TPad(Form("pad4x4Panel%s_14", add.Data()), "", arrayBoundX[2], arrayBoundY[1],arrayBoundX[3], arrayBoundY[0],-1, -1, -2);
0441 padMulti[15] = new TPad(Form("pad4x4Panel%s_15", add.Data()), "", arrayBoundX[3], arrayBoundY[1],arrayBoundX[4], arrayBoundY[0],-1, -1, -2);
0442
0443
0444
0445
0446 DefaultPadSettings( padMulti[0], relativeMarginsX[0], relativeMarginsX[1], relativeMarginsY[1], relativeMarginsY[2]);
0447 DefaultPadSettings( padMulti[1], relativeMarginsX[1], relativeMarginsX[1], relativeMarginsY[1], relativeMarginsY[2]);
0448 DefaultPadSettings( padMulti[2], relativeMarginsX[1], relativeMarginsX[1], relativeMarginsY[1], relativeMarginsY[2]);
0449 DefaultPadSettings( padMulti[3], relativeMarginsX[1], relativeMarginsX[2], relativeMarginsY[1], relativeMarginsY[2]);
0450 DefaultPadSettings( padMulti[4], relativeMarginsX[0], relativeMarginsX[1], relativeMarginsY[1], relativeMarginsY[1]);
0451 DefaultPadSettings( padMulti[5], relativeMarginsX[1], relativeMarginsX[1], relativeMarginsY[1], relativeMarginsY[1]);
0452 DefaultPadSettings( padMulti[6], relativeMarginsX[1], relativeMarginsX[1], relativeMarginsY[1], relativeMarginsY[1]);
0453 DefaultPadSettings( padMulti[7], relativeMarginsX[1], relativeMarginsX[2], relativeMarginsY[1], relativeMarginsY[1]);
0454 DefaultPadSettings( padMulti[8], relativeMarginsX[0], relativeMarginsX[1], relativeMarginsY[1], relativeMarginsY[1]);
0455 DefaultPadSettings( padMulti[9], relativeMarginsX[1], relativeMarginsX[1], relativeMarginsY[1], relativeMarginsY[1]);
0456 DefaultPadSettings( padMulti[10], relativeMarginsX[1], relativeMarginsX[1], relativeMarginsY[1], relativeMarginsY[1]);
0457 DefaultPadSettings( padMulti[11], relativeMarginsX[1], relativeMarginsX[2], relativeMarginsY[1], relativeMarginsY[1]);
0458 DefaultPadSettings( padMulti[12], relativeMarginsX[0], relativeMarginsX[1], relativeMarginsY[0], relativeMarginsY[1]);
0459 DefaultPadSettings( padMulti[13], relativeMarginsX[1], relativeMarginsX[1], relativeMarginsY[0], relativeMarginsY[1]);
0460 DefaultPadSettings( padMulti[14], relativeMarginsX[1], relativeMarginsX[1], relativeMarginsY[0], relativeMarginsY[1]);
0461 DefaultPadSettings( padMulti[15], relativeMarginsX[1], relativeMarginsX[2], relativeMarginsY[0], relativeMarginsY[1]);
0462
0463 for (int i = 0; i < 12; i++)
0464 legPlace_Y[i] = 1-relativeMarginsY[1];
0465 for (int i = 12; i < 16; i++)
0466 legPlace_Y[i] = 1-relativeMarginsY[0];
0467 if (rightCorner){
0468 for (int i = 0; i < 16; i++){
0469 if ((i+1)%4 == 0)
0470 legPlace_X[i] = 1-relativeMarginsX[2];
0471 else
0472 legPlace_X[i] = 1-relativeMarginsX[1];
0473 }
0474 } else {
0475 for (int i = 0; i < 16; i++){
0476 if (i%4 == 0)
0477 legPlace_X[i] = 1-relativeMarginsX[0];
0478 else
0479 legPlace_X[i] = 1-relativeMarginsX[1];
0480 }
0481 }
0482
0483 for (Int_t p = 0; p < 16; p++){
0484 if (padMulti[p]->XtoPixel(padMulti[p]->GetX2()) < padMulti[p]->YtoPixel(padMulti[p]->GetY1())){
0485 relTextSize[p] = (Double_t)textSizePixel/padMulti[p]->XtoPixel(padMulti[p]->GetX2()) ;
0486 } else {
0487 relTextSize[p] = (Double_t)textSizePixel/padMulti[p]->YtoPixel(padMulti[p]->GetY1());
0488 }
0489 if(debug > 1)std::cout << p << "\t" << legPlace_X[p]<< "\t" << legPlace_Y[p] << "\t" << relTextSize[p] << std::endl;
0490 }
0491 return;
0492 }
0493
0494
0495
0496
0497 void MultiCanvas::CreateCanvasAndPadsForAsicLFHCalTBPlot(Int_t textSizePixel,
0498 Double_t marginLeft,
0499 TString add,
0500 bool rightCorner,
0501 int debug
0502 ){
0503 Double_t arrayBoundX[9];
0504 Double_t arrayBoundY[9];
0505 Double_t relativeMarginsX[3];
0506 Double_t relativeMarginsY[3];
0507 ReturnCorrectValuesForCanvasScaling(3300,3300, 8, 8,marginLeft, 0.005, 0.005,marginLeft,arrayBoundX,arrayBoundY,relativeMarginsX,relativeMarginsY, debug);
0508
0509 canvasMulti = new TCanvas(Form("canvas8x8Panel%s", add.Data()),"",0,0,3300,3300);
0510 canvasMulti->cd();
0511
0512 for (int k = 0; k< 8; k++){
0513 padMulti[k+0*8] = new TPad(Form("pad8x8Panel%s_%d", add.Data(),k+0*8), "", arrayBoundX[k], arrayBoundY[8], arrayBoundX[k+1], arrayBoundY[7],-1, -1, -2);
0514 padMulti[k+1*8] = new TPad(Form("pad8x8Panel%s_%d", add.Data(),k+8), "", arrayBoundX[k], arrayBoundY[7], arrayBoundX[k+1], arrayBoundY[6],-1, -1, -2);
0515 padMulti[k+2*8] = new TPad(Form("pad8x8Panel%s_%d", add.Data(),k+2*8), "", arrayBoundX[k], arrayBoundY[6], arrayBoundX[k+1], arrayBoundY[5],-1, -1, -2);
0516 padMulti[k+3*8] = new TPad(Form("pad8x8Panel%s_%d", add.Data(),k+3*8), "", arrayBoundX[k], arrayBoundY[5], arrayBoundX[k+1], arrayBoundY[4],-1, -1, -2);
0517 padMulti[k+4*8] = new TPad(Form("pad8x8Panel%s_%d", add.Data(),k+4*8), "", arrayBoundX[k], arrayBoundY[4], arrayBoundX[k+1], arrayBoundY[3],-1, -1, -2);
0518 padMulti[k+5*8] = new TPad(Form("pad8x8Panel%s_%d", add.Data(),k+5*8), "", arrayBoundX[k], arrayBoundY[3], arrayBoundX[k+1], arrayBoundY[2],-1, -1, -2);
0519 padMulti[k+6*8] = new TPad(Form("pad8x8Panel%s_%d", add.Data(),k+6*8), "", arrayBoundX[k], arrayBoundY[2], arrayBoundX[k+1], arrayBoundY[1],-1, -1, -2);
0520 padMulti[k+7*8] = new TPad(Form("pad8x8Panel%s_%d", add.Data(),k+7*8), "", arrayBoundX[k], arrayBoundY[1], arrayBoundX[k+1], arrayBoundY[0],-1, -1, -2);
0521 }
0522
0523 for (int k = 0; k < 64; k++){
0524
0525 if (k%8 ==0 && k > 7 && k < 56 )
0526 DefaultPadSettings( padMulti[k], relativeMarginsX[0], relativeMarginsX[1], relativeMarginsY[1], relativeMarginsY[1]);
0527 else if (k == 0)
0528 DefaultPadSettings( padMulti[k], relativeMarginsX[0], relativeMarginsX[1], relativeMarginsY[1], relativeMarginsY[2]);
0529 else if (k == 56)
0530 DefaultPadSettings( padMulti[k], relativeMarginsX[0], relativeMarginsX[1], relativeMarginsY[0], relativeMarginsY[1]);
0531
0532
0533 else if (k%8 ==7 && k > 7 && k < 56 )
0534 DefaultPadSettings( padMulti[k], relativeMarginsX[1], relativeMarginsX[2], relativeMarginsY[1], relativeMarginsY[1]);
0535 else if (k == 7)
0536 DefaultPadSettings( padMulti[k], relativeMarginsX[1], relativeMarginsX[2], relativeMarginsY[1], relativeMarginsY[2]);
0537 else if (k == 63)
0538 DefaultPadSettings( padMulti[k], relativeMarginsX[1], relativeMarginsX[2], relativeMarginsY[0], relativeMarginsY[1]);
0539
0540
0541 else if (k > 0 && k < 7)
0542 DefaultPadSettings( padMulti[k], relativeMarginsX[1], relativeMarginsX[1], relativeMarginsY[1], relativeMarginsY[2]);
0543
0544 else if (k > 56 && k < 63)
0545 DefaultPadSettings( padMulti[k], relativeMarginsX[1], relativeMarginsX[1], relativeMarginsY[0], relativeMarginsY[1]);
0546
0547 else
0548 DefaultPadSettings( padMulti[k], relativeMarginsX[1], relativeMarginsX[1], relativeMarginsY[1], relativeMarginsY[1]);
0549 }
0550
0551
0552 for (int i = 0; i < 56; i++)
0553 legPlace_Y[i] = 1-relativeMarginsY[1];
0554
0555 for (int i = 56; i < 64; i++)
0556 legPlace_Y[i] = 1-relativeMarginsY[0];
0557
0558
0559 if (rightCorner){
0560 for (int i = 0; i < 64; i++){
0561 if (i%8 == 7)
0562 legPlace_X[i] = 1-relativeMarginsX[2];
0563 else
0564 legPlace_X[i] = 1-relativeMarginsX[1];
0565 }
0566
0567 } else {
0568 for (int i = 0; i < 64; i++){
0569 if (i%8 == 0)
0570 legPlace_X[i] = relativeMarginsX[0];
0571 else
0572 legPlace_X[i] = relativeMarginsX[1];
0573 }
0574 }
0575
0576 for (Int_t p = 0; p < 64; p++){
0577 if (padMulti[p]->XtoPixel(padMulti[p]->GetX2()) < padMulti[p]->YtoPixel(padMulti[p]->GetY1())){
0578 relTextSize[p] = (Double_t)textSizePixel/padMulti[p]->XtoPixel(padMulti[p]->GetX2()) ;
0579 } else {
0580 relTextSize[p] = (Double_t)textSizePixel/padMulti[p]->YtoPixel(padMulti[p]->GetY1());
0581 }
0582 if(debug > 1)std::cout << p << "\t" << legPlace_X[p]<< "\t" << legPlace_Y[p] << "\t" << relTextSize[p] << std::endl;
0583 }
0584 return;
0585 }
0586
0587
0588
0589 void MultiCanvas::DefaultCanvasSettings( TCanvas* c1,
0590 Double_t leftMargin,
0591 Double_t rightMargin,
0592 Double_t topMargin,
0593 Double_t bottomMargin){
0594 c1->SetTickx();
0595 c1->SetTicky();
0596 c1->SetGridx(0);
0597 c1->SetGridy(0);
0598 c1->SetLogy(0);
0599 c1->SetLeftMargin(leftMargin);
0600 c1->SetRightMargin(rightMargin);
0601 c1->SetTopMargin(topMargin);
0602 c1->SetBottomMargin(bottomMargin);
0603 c1->SetFillColor(0);
0604 }
0605
0606
0607 void MultiCanvas::DefaultPadSettings( TPad* pad1,
0608 Double_t leftMargin,
0609 Double_t rightMargin,
0610 Double_t topMargin,
0611 Double_t bottomMargin){
0612 pad1->SetFillColor(0);
0613 pad1->GetFrame()->SetFillColor(0);
0614 pad1->SetBorderMode(0);
0615 pad1->SetLeftMargin(leftMargin);
0616 pad1->SetBottomMargin(bottomMargin);
0617 pad1->SetRightMargin(rightMargin);
0618 pad1->SetTopMargin(topMargin);
0619 pad1->SetTickx();
0620 pad1->SetTicky();
0621 }
0622
0623
0624 void MultiCanvas::PlotNoiseWithFits( std::map<int,TileSpectra> spectra, int option,
0625 Double_t xPMin, Double_t xPMax, Double_t scaleYMax,
0626 TString nameOutputBase, TString suffix, RunInfo currRunInfo, Calib* calib, int debug ){
0627
0628 std::cout << "plotting: " << nameOutputBase.Data() << std::endl;
0629 Setup* setup = Setup::GetInstance();
0630 if (detType == DetConf::Type::SingleTile){
0631 for (Int_t l = 0; l < setup->GetNMaxLayer()+1; l++){
0632 for (Int_t m = 0; m < setup->GetNMaxModule()+1; m++){
0633 if (l%10 == 0 && l > 0 && debug > 0)
0634 std::cout << "============================== layer " << l << " / " << setup->GetNMaxLayer() << " layers" << std::endl;
0635 if (!setup->IsLayerOn(l,m)){
0636 std::cout << "====> layer " << l << " in module " << m << " not enabled" << std::endl;
0637 continue;
0638 }
0639 PlotNoiseWithFits1MLayer (canvasMulti, legPlace_X[0], legPlace_Y[0], relTextSize[0], textSize,
0640 spectra, option, xPMin, xPMax, scaleYMax, l, m,
0641 Form("%s_Mod%02d_Layer%02d.%s" ,nameOutputBase.Data(), m, l, suffix.Data()), currRunInfo);
0642 }
0643 }
0644 } else if (detType == DetConf::Type::Single2MH){
0645 for (Int_t l = 0; l < setup->GetNMaxLayer()+1; l++){
0646 for (Int_t m = 0; m < setup->GetNMaxModule()+1; m++){
0647 if (l%10 == 0 && l > 0 && debug > 0)
0648 std::cout << "============================== layer " << l << " / " << setup->GetNMaxLayer() << " layers" << std::endl;
0649 if (!setup->IsLayerOn(l,m)){
0650 std::cout << "====> layer " << l << " in module " << m << " not enabled" << std::endl;
0651 continue;
0652 }
0653 PlotNoiseWithFits2MLayer (canvasMulti, padMulti, legPlace_X, legPlace_Y, relTextSize, textSize,
0654 spectra, option, xPMin, xPMax, scaleYMax, l, m,
0655 Form("%s_Mod%02d_Layer%02d.%s" ,nameOutputBase.Data(), m, l, suffix.Data()), currRunInfo);
0656
0657 }
0658 }
0659 } else if (detType == DetConf::Type::Single8M){
0660 for (Int_t l = 0; l < setup->GetNMaxLayer()+1; l++){
0661 for (Int_t m = 0; m < setup->GetNMaxModule()+1; m++){
0662 if (l%10 == 0 && l > 0 && debug > 0)
0663 std::cout << "============================== layer " << l << " / " << setup->GetNMaxLayer() << " layers" << std::endl;
0664 if (!setup->IsLayerOn(l,m)){
0665 std::cout << "====> layer " << l << " in module " << m << " not enabled" << std::endl;
0666 continue;
0667 }
0668 PlotNoiseWithFits8MLayer (canvasMulti, padMulti, legPlace_X, legPlace_Y, relTextSize, textSize,
0669 spectra, option, xPMin, xPMax, scaleYMax, l, m,
0670 Form("%s_Mod%02d_Layer%02d.%s" ,nameOutputBase.Data(), m, l, suffix.Data()), currRunInfo);
0671 }
0672 }
0673 } else if (detType == DetConf::Type::Dual8M){
0674 for (Int_t l = 0; l < setup->GetNMaxLayer()+1; l++){
0675 if (l%5 == 0 && l > 0 && debug > 0)
0676 std::cout << "============================== layer " << l << " / " << setup->GetNMaxLayer() << " layers" << std::endl;
0677 if (!setup->IsLayerOn(l,-1)){
0678 std::cout << "====> layer " << l << " not enabled" << std::endl;
0679 continue;
0680 }
0681 if (!calib->IsLayerEnabled(l,-1)){
0682 std::cout << "====> layer " << l << " all channels masked" << std::endl;
0683 continue;
0684 }
0685
0686 PlotNoiseWithFits2ModLayer (canvasMulti, padMulti, legPlace_X, legPlace_Y,
0687 relTextSize, textSize,
0688 spectra, option, xPMin, xPMax, scaleYMax, l,
0689 Form("%s_Layer%02d.%s" ,nameOutputBase.Data(), l, suffix.Data()), currRunInfo);
0690 }
0691 }
0692 }
0693
0694
0695
0696
0697
0698 void MultiCanvas::PlotCorr2DLayer( std::map<int,TileSpectra> spectra, int option,
0699 Double_t xPMin, Double_t xPMax, Double_t minY, Double_t maxY,
0700 TString nameOutputBase, TString suffix, RunInfo currRunInfo, Calib* calib,
0701 int noCalib, int triggerCha, int debug ){
0702
0703 std::cout << "plotting: " << nameOutputBase.Data() << std::endl;
0704 Setup* setup = Setup::GetInstance();
0705
0706 if (detType == DetConf::Type::SingleTile){
0707 for (Int_t l = 0; l < setup->GetNMaxLayer()+1; l++){
0708 for (Int_t m = 0; m < setup->GetNMaxModule()+1; m++){
0709 if (l%10 == 0 && l > 0 && debug > 0)
0710 std::cout << "============================== layer " << l << " / " << setup->GetNMaxLayer() << " layers" << std::endl;
0711 if (!setup->IsLayerOn(l,m)){
0712 std::cout << "====> layer " << l << " in module " << m << " not enabled" << std::endl;
0713 continue;
0714 }
0715 if (!calib->IsLayerEnabled(l,m)){
0716 std::cout << "====> layer " << l <<" in module " << m << " all channels masked" << std::endl;
0717 continue;
0718 }
0719
0720 PlotCorr2D1MLayer (canvasMulti, legPlace_X[0], legPlace_Y[0], relTextSize[0], textSize,
0721 spectra, option, xPMin, xPMax, maxY, l, m,
0722 Form("%s_Mod%02d_Layer%02d.%s" ,nameOutputBase.Data(), m, l, suffix.Data()), currRunInfo);
0723 }
0724 }
0725
0726 } else if (detType == DetConf::Type::Single2MH){
0727 for (Int_t l = 0; l < setup->GetNMaxLayer()+1; l++){
0728 for (Int_t m = 0; m < setup->GetNMaxModule()+1; m++){
0729 if (l%10 == 0 && l > 0 && debug > 0)
0730 std::cout << "============================== layer " << l << " / " << setup->GetNMaxLayer() << " layers" << std::endl;
0731 if (!setup->IsLayerOn(l,m)){
0732 std::cout << "====> layer " << l << " in module " << m << " not enabled" << std::endl;
0733 continue;
0734 }
0735 PlotCorr2D2MLayer(canvasMulti,padMulti, legPlace_X, legPlace_Y, relTextSize, textSize,
0736 spectra, option, xPMin, xPMin, maxY, l, m,
0737 Form("%s_Mod%02d_Layer%02d.%s" ,nameOutputBase.Data(), m, l, suffix.Data()), currRunInfo, noCalib);
0738 }
0739 }
0740
0741 } else if ( detType == DetConf::Type::Single2MV){
0742 std::cout << "PlotCorr2DLayer: this option hasn't been implemented yet!" << std::endl;
0743
0744 } else if (detType == DetConf::Type::Single8M){
0745 for (Int_t l = 0; l < setup->GetNMaxLayer()+1; l++){
0746 for (Int_t m = 0; m < setup->GetNMaxModule()+1; m++){
0747 if (l%10 == 0 && l > 0 && debug > 0)
0748 std::cout << "============================== layer " << l << " / " << setup->GetNMaxLayer() << " layers" << std::endl;
0749 if (!setup->IsLayerOn(l,m)){
0750 std::cout << "====> layer " << l << " in module " << m << " not enabled" << std::endl;
0751 continue;
0752 }
0753 PlotCorr2D8MLayer(canvasMulti,padMulti, legPlace_X, legPlace_Y, relTextSize, textSize,
0754 spectra, option, xPMin, xPMax, maxY, l, m,
0755 Form("%s_Mod%02d_Layer%02d.%s" ,nameOutputBase.Data(), m, l, suffix.Data()), currRunInfo, noCalib);
0756 }
0757 }
0758
0759 } else if (detType == DetConf::Type::Dual8M){
0760 for (Int_t l = 0; l < setup->GetNMaxLayer()+1; l++){
0761 if (l%5 == 0 && l > 0 && debug > 0)
0762 std::cout << "============================== layer " << l << " / " << setup->GetNMaxLayer() << " layers" << std::endl;
0763 if (!setup->IsLayerOn(l,-1)){
0764 std::cout << "====> layer " << l << " not enabled" << std::endl;
0765 continue;
0766 }
0767 if (!calib->IsLayerEnabled(l,-1)){
0768 std::cout << "====> layer " << l << " all channels masked" << std::endl;
0769 continue;
0770 }
0771
0772 PlotCorr2D2ModLayer (canvasMulti, padMulti, legPlace_X, legPlace_Y, relTextSize, textSize,
0773 spectra, option, xPMin, xPMax, minY, maxY, l,
0774 Form("%s_Layer%02d.%s" ,nameOutputBase.Data(), l, suffix.Data()), currRunInfo, noCalib, triggerCha);
0775 }
0776
0777 } else if ( detType == DetConf::Type::LargeTB){
0778 std::cout << "PlotCorr2DLayer: this option hasn't been implemented yet!" << std::endl;
0779
0780
0781 } else if ( detType == DetConf::Type::Asic){
0782 for (Int_t a = 0; a < setup->GetNMaxROUnit()+1; a++){
0783 std::cout << "====> asic " << a << std::endl;
0784 PlotCorr2DAsicLFHCal(canvasMulti, padMulti, legPlace_X, legPlace_Y, relTextSize, textSize,
0785 spectra, option, xPMin, xPMax, minY, maxY, a,
0786 Form("%s_Asic%02d.%s" ,nameOutputBase.Data(), a, suffix.Data()), currRunInfo, noCalib, triggerCha);
0787 }
0788 }
0789 }
0790
0791
0792
0793
0794 void MultiCanvas::PlotNoiseAdvWithFits( std::map<int,TileSpectra> spectra, std::map<int,TileSpectra> spectraNoise,
0795 int option, Double_t xPMin, Double_t xPMax, Double_t scaleYMax,
0796 TString nameOutputBase, TString suffix, RunInfo currRunInfo, Calib* calib, int debug ){
0797
0798 std::cout << "plotting: " << nameOutputBase.Data() << std::endl;
0799 Setup* setup = Setup::GetInstance();
0800
0801 if (detType == DetConf::Type::SingleTile){
0802 std::cout << "PlotNoiseAdvWithFits: this option hasn't been implemented yet!" << std::endl;
0803
0804 } else if (detType == DetConf::Type::Single2MH){
0805 std::cout << "PlotNoiseAdvWithFits: this option hasn't been implemented yet!" << std::endl;
0806
0807 } else if ( detType == DetConf::Type::Single2MV){
0808 std::cout << "PlotNoiseAdvWithFits: this option hasn't been implemented yet!" << std::endl;
0809
0810 } else if (detType == DetConf::Type::Single8M){
0811 for (Int_t l = 0; l < setup->GetNMaxLayer()+1; l++){
0812 for (Int_t m = 0; m < setup->GetNMaxModule()+1; m++){
0813 if (l%10 == 0 && l > 0 && debug > 0)
0814 std::cout << "============================== layer " << l << " / " << setup->GetNMaxLayer() << " layers" << std::endl;
0815 if (!setup->IsLayerOn(l,m)){
0816 std::cout << "====> layer " << l << " in module " << m << " not enabled" << std::endl;
0817 continue;
0818 }
0819 PlotNoiseAdvWithFits8MLayer (canvasMulti,padMulti, legPlace_X, legPlace_Y, relTextSize, textSize,
0820 spectra, spectraNoise, option, xPMin, xPMax, scaleYMax, l, m,
0821 Form("%s_Mod%02d_Layer%02d.%s" ,nameOutputBase.Data(), m, l, suffix.Data()), currRunInfo);
0822 }
0823 }
0824
0825 } else if (detType == DetConf::Type::Dual8M){
0826 for (Int_t l = 0; l < setup->GetNMaxLayer()+1; l++){
0827 if (l%5 == 0 && l > 0 && debug > 0)
0828 std::cout << "============================== layer " << l << " / " << setup->GetNMaxLayer() << " layers" << std::endl;
0829 if (!setup->IsLayerOn(l,-1)){
0830 std::cout << "====> layer " << l << " not enabled" << std::endl;
0831 continue;
0832 }
0833 if (!calib->IsLayerEnabled(l,-1)){
0834 std::cout << "====> layer " << l << " all channels masked" << std::endl;
0835 continue;
0836 }
0837 PlotNoiseAdvWithFits2ModLayer (canvasMulti,padMulti, legPlace_X, legPlace_Y, relTextSize, textSize,
0838 spectra, spectraNoise, option, xPMin, xPMax, scaleYMax, l,
0839 Form("%s_Layer%02d.%s" ,nameOutputBase.Data(), l, suffix.Data()), currRunInfo);
0840 }
0841
0842 } else if ( detType == DetConf::Type::LargeTB){
0843 std::cout << "PlotNoiseAdvWithFits: this option hasn't been implemented yet!" << std::endl;
0844
0845
0846 } else if ( detType == DetConf::Type::Asic){
0847 std::cout << "PlotNoiseAdvWithFits: this option hasn't been implemented yet!" << std::endl;
0848 }
0849 }
0850
0851
0852
0853
0854 void MultiCanvas::PlotSpectra( std::map<int,TileSpectra> spectra, int option,
0855 Double_t xPMin, Double_t xPMax, Double_t scaleYMax,
0856 TString nameOutputBase, TString suffix, RunInfo currRunInfo, Calib* calib,
0857 int debug ){
0858
0859 std::cout << "plotting: " << nameOutputBase.Data() << std::endl;
0860 Setup* setup = Setup::GetInstance();
0861
0862 if (detType == DetConf::Type::SingleTile){
0863 for (Int_t l = 0; l < setup->GetNMaxLayer()+1; l++){
0864 for (Int_t m = 0; m < setup->GetNMaxModule()+1; m++){
0865 if (l%10 == 0 && l > 0 && debug > 0)
0866 std::cout << "============================== layer " << l << " / " << setup->GetNMaxLayer() << " layers" << std::endl;
0867 if (!setup->IsLayerOn(l,m)){
0868 std::cout << "====> layer " << l << " in module " << m << " not enabled" << std::endl;
0869 continue;
0870 }
0871 if (!calib->IsLayerEnabled(l,m)){
0872 std::cout << "====> layer " << l <<" in module " << m << " all channels masked" << std::endl;
0873 continue;
0874 }
0875 PlotSpectra1MLayer (canvasMulti, legPlace_X[0], legPlace_Y[0], relTextSize[0], textSize,
0876 spectra, option, xPMin, xPMax, scaleYMax, l, m,
0877 Form("%s_Mod%02d_Layer%02d.%s" ,nameOutputBase.Data(), m, l, suffix.Data()), currRunInfo);
0878 }
0879 }
0880
0881 } else if (detType == DetConf::Type::Single2MH){
0882 for (Int_t l = 0; l < setup->GetNMaxLayer()+1; l++){
0883 for (Int_t m = 0; m < setup->GetNMaxModule()+1; m++){
0884 if (l%10 == 0 && l > 0 && debug > 0)
0885 std::cout << "============================== layer " << l << " / " << setup->GetNMaxLayer() << " layers" << std::endl;
0886 if (!setup->IsLayerOn(l,m)){
0887 std::cout << "====> layer " << l << " in module " << m << " not enabled" << std::endl;
0888 continue;
0889 }
0890 PlotSpectra2MLayer (canvasMulti,padMulti, legPlace_X, legPlace_Y, relTextSize, textSize,
0891 spectra, option, xPMin, xPMax, scaleYMax, l, m,
0892 Form("%s_Mod%02d_Layer%02d.%s" ,nameOutputBase.Data(), m, l, suffix.Data()), currRunInfo);
0893 }
0894 }
0895
0896 } else if ( detType == DetConf::Type::Single2MV){
0897 std::cout << "PlotSpectra: this option hasn't been implemented yet!" << std::endl;
0898
0899 } else if (detType == DetConf::Type::Single8M){
0900 for (Int_t l = 0; l < setup->GetNMaxLayer()+1; l++){
0901 for (Int_t m = 0; m < setup->GetNMaxModule()+1; m++){
0902 if (l%10 == 0 && l > 0 && debug > 0)
0903 std::cout << "============================== layer " << l << " / " << setup->GetNMaxLayer() << " layers" << std::endl;
0904 if (!setup->IsLayerOn(l,m)){
0905 std::cout << "====> layer " << l << " in module " << m << " not enabled" << std::endl;
0906 continue;
0907 }
0908 PlotSpectra8MLayer (canvasMulti,padMulti, legPlace_X, legPlace_Y, relTextSize, textSize,
0909 spectra, option, xPMin, xPMax, scaleYMax, l, m,
0910 Form("%s_Mod%02d_Layer%02d.%s" ,nameOutputBase.Data(), m, l, suffix.Data()), currRunInfo);
0911 }
0912 }
0913
0914 } else if (detType == DetConf::Type::Dual8M){
0915 for (Int_t l = 0; l < setup->GetNMaxLayer()+1; l++){
0916 if (l%5 == 0 && l > 0 && debug > 0)
0917 std::cout << "============================== layer " << l << " / " << setup->GetNMaxLayer() << " layers" << std::endl;
0918 if (!setup->IsLayerOn(l,-1)){
0919 std::cout << "====> layer " << l << " not enabled" << std::endl;
0920 continue;
0921 }
0922 if (!calib->IsLayerEnabled(l,-1)){
0923 std::cout << "====> layer " << l << " all channels masked" << std::endl;
0924 continue;
0925 }
0926 PlotSpectra2ModLayer (canvasMulti, padMulti, legPlace_X, legPlace_Y, relTextSize, textSize,
0927 spectra, option, xPMin, xPMax, scaleYMax, l,
0928 Form("%s_Layer%02d.%s" ,nameOutputBase.Data(), l, suffix.Data()), currRunInfo);
0929 }
0930
0931 } else if ( detType == DetConf::Type::LargeTB){
0932 std::cout << "PlotSpectra: this option hasn't been implemented yet!" << std::endl;
0933
0934
0935 } else if ( detType == DetConf::Type::Asic){
0936 std::cout << "PlotSpectra: this option hasn't been implemented yet!" << std::endl;
0937 }
0938 }
0939
0940
0941
0942
0943 void MultiCanvas::PlotCorrWithFits( std::map<int,TileSpectra> spectra, int option,
0944 Double_t xPMin, Double_t xPMax, Double_t minY, Double_t maxY,
0945 TString nameOutputBase, TString suffix, RunInfo currRunInfo, Calib* calib,
0946 int debug ){
0947
0948 std::cout << "plotting: " << nameOutputBase.Data() << std::endl;
0949 Setup* setup = Setup::GetInstance();
0950
0951 if (detType == DetConf::Type::SingleTile){
0952 std::cout << "PlotCorrWithFits: this option hasn't been implemented yet!" << std::endl;
0953
0954 } else if (detType == DetConf::Type::Single2MH){
0955 std::cout << "PlotCorrWithFits: this option hasn't been implemented yet!" << std::endl;
0956
0957 } else if ( detType == DetConf::Type::Single2MV){
0958 std::cout << "PlotCorrWithFits: this option hasn't been implemented yet!" << std::endl;
0959
0960 } else if (detType == DetConf::Type::Single8M){
0961 for (Int_t l = 0; l < setup->GetNMaxLayer()+1; l++){
0962 for (Int_t m = 0; m < setup->GetNMaxModule()+1; m++){
0963 if (l%10 == 0 && l > 0 && debug > 0)
0964 std::cout << "============================== layer " << l << " / " << setup->GetNMaxLayer() << " layers" << std::endl;
0965 if (!setup->IsLayerOn(l,m)){
0966 std::cout << "====> layer " << l << " in module " << m << " not enabled" << std::endl;
0967 continue;
0968 }
0969 PlotCorrWithFits8MLayer(canvasMulti,padMulti, legPlace_X, legPlace_Y, relTextSize, textSize,
0970 spectra, option, xPMin, xPMax, maxY, l, m,
0971 Form("%s_Mod%02d_Layer%02d.%s" ,nameOutputBase.Data(), m, l, suffix.Data()), currRunInfo);
0972 }
0973 }
0974
0975 } else if (detType == DetConf::Type::Dual8M){
0976 for (Int_t l = 0; l < setup->GetNMaxLayer()+1; l++){
0977 if (l%5 == 0 && l > 0 && debug > 0)
0978 std::cout << "============================== layer " << l << " / " << setup->GetNMaxLayer() << " layers" << std::endl;
0979 if (!setup->IsLayerOn(l,-1)){
0980 std::cout << "====> layer " << l << " not enabled" << std::endl;
0981 continue;
0982 }
0983 if (!calib->IsLayerEnabled(l,-1)){
0984 std::cout << "====> layer " << l << " all channels masked" << std::endl;
0985 continue;
0986 }
0987 PlotCorrWithFits2ModLayer (canvasMulti, padMulti, legPlace_X, legPlace_Y, relTextSize, textSize,
0988 spectra, option, xPMin, xPMax, maxY, l,
0989 Form("%s_Layer%02d.%s" ,nameOutputBase.Data(), l, suffix.Data()), currRunInfo);
0990 }
0991
0992 } else if ( detType == DetConf::Type::LargeTB){
0993 std::cout << "PlotCorrWithFits: this option hasn't been implemented yet!" << std::endl;
0994
0995
0996 } else if ( detType == DetConf::Type::Asic){
0997 std::cout << "PlotCorrWithFits: this option hasn't been implemented yet!" << std::endl;
0998 }
0999 }
1000
1001
1002
1003
1004
1005 void MultiCanvas::PlotMipWithFits( std::map<int,TileSpectra> spectra, std::map<int,TileSpectra> spectraTrigg,
1006 int option, Double_t xPMin, Double_t xPMax, Double_t scaleYMax,
1007 TString nameOutputBase, TString suffix, RunInfo currRunInfo, Calib* calib, int debug ){
1008
1009 std::cout << "plotting: " << nameOutputBase.Data() << std::endl;
1010 Setup* setup = Setup::GetInstance();
1011
1012 if (detType == DetConf::Type::SingleTile){
1013 std::cout << "PlotMipWithFits: this option hasn't been implemented yet!" << std::endl;
1014
1015 } else if (detType == DetConf::Type::Single2MH){
1016 std::cout << "PlotMipWithFits: this option hasn't been implemented yet!" << std::endl;
1017
1018 } else if ( detType == DetConf::Type::Single2MV){
1019 std::cout << "PlotMipWithFits: this option hasn't been implemented yet!" << std::endl;
1020
1021 } else if (detType == DetConf::Type::Single8M){
1022 for (Int_t l = 0; l < setup->GetNMaxLayer()+1; l++){
1023 for (Int_t m = 0; m < setup->GetNMaxModule()+1; m++){
1024 if (l%10 == 0 && l > 0 && debug > 0)
1025 std::cout << "============================== layer " << l << " / " << setup->GetNMaxLayer() << " layers" << std::endl;
1026 if (!setup->IsLayerOn(l,m)){
1027 std::cout << "====> layer " << l << " in module " << m << " not enabled" << std::endl;
1028 continue;
1029 }
1030 PlotMipWithFits8MLayer (canvasMulti,padMulti, legPlace_X, legPlace_Y, relTextSize, textSize,
1031 spectra, spectraTrigg, option, xPMin, xPMax, scaleYMax, l, m,
1032 Form("%s_Mod%02d_Layer%02d.%s" ,nameOutputBase.Data(), m, l, suffix.Data()), currRunInfo);
1033 }
1034 }
1035
1036 } else if (detType == DetConf::Type::Dual8M){
1037 for (Int_t l = 0; l < setup->GetNMaxLayer()+1; l++){
1038 if (l%5 == 0 && l > 0 && debug > 0)
1039 std::cout << "============================== layer " << l << " / " << setup->GetNMaxLayer() << " layers" << std::endl;
1040 if (!setup->IsLayerOn(l,-1)){
1041 std::cout << "====> layer " << l << " not enabled" << std::endl;
1042 continue;
1043 }
1044 if (!calib->IsLayerEnabled(l,-1)){
1045 std::cout << "====> layer " << l << " all channels masked" << std::endl;
1046 continue;
1047 }
1048 PlotMipWithFits2ModLayer (canvasMulti,padMulti, legPlace_X, legPlace_Y, relTextSize, textSize,
1049 spectra, spectraTrigg, option, xPMin, xPMax, scaleYMax, l,
1050 Form("%s_Layer%02d.%s" ,nameOutputBase.Data(), l, suffix.Data()), currRunInfo);
1051 }
1052
1053 } else if ( detType == DetConf::Type::LargeTB){
1054 std::cout << "PlotMipWithFits: this option hasn't been implemented yet!" << std::endl;
1055
1056
1057 } else if ( detType == DetConf::Type::Asic){
1058 std::cout << "PlotMipWithFits: this option hasn't been implemented yet!" << std::endl;
1059 }
1060 }
1061
1062
1063
1064
1065 void MultiCanvas::PlotTriggerPrim( std::map<int,TileSpectra> spectra,
1066 double avMip, double facLow, double facHigh,
1067 Double_t xPMin, Double_t xPMax, Double_t scaleYMax,
1068 TString nameOutputBase, TString suffix, RunInfo currRunInfo, Calib* calib,
1069 int debug){
1070
1071
1072 std::cout << "plotting: " << nameOutputBase.Data() << std::endl;
1073
1074
1075 Setup* setup = Setup::GetInstance();
1076
1077 if (detType == DetConf::Type::SingleTile){
1078 std::cout << "PlotTriggerPrim: this option hasn't been implemented yet!" << std::endl;
1079
1080 } else if (detType == DetConf::Type::Single2MH){
1081 std::cout << "PlotTriggerPrim: this option hasn't been implemented yet!" << std::endl;
1082
1083 } else if ( detType == DetConf::Type::Single2MV){
1084 std::cout << "PlotTriggerPrim: this option hasn't been implemented yet!" << std::endl;
1085
1086 } else if (detType == DetConf::Type::Single8M){
1087 for (Int_t l = 0; l < setup->GetNMaxLayer()+1; l++){
1088 for (Int_t m = 0; m < setup->GetNMaxModule()+1; m++){
1089 if (l%10 == 0 && l > 0 && debug > 0)
1090 std::cout << "============================== layer " << l << " / " << setup->GetNMaxLayer() << " layers" << std::endl;
1091 if (!setup->IsLayerOn(l,m)){
1092 std::cout << "====> layer " << l << " in module " << m << " not enabled" << std::endl;
1093 continue;
1094 }
1095 PlotTriggerPrim8MLayer (canvasMulti,padMulti, legPlace_X, legPlace_Y, relTextSize, textSize,
1096 spectra, avMip, facLow, facHigh, xPMin, xPMax, scaleYMax, l, m,
1097 Form("%s_Mod%02d_Layer%02d.%s" ,nameOutputBase.Data(), m, l, suffix.Data()), currRunInfo);
1098 }
1099 }
1100
1101 } else if (detType == DetConf::Type::Dual8M){
1102 for (Int_t l = 0; l < setup->GetNMaxLayer()+1; l++){
1103 if (l%5 == 0 && l > 0 && debug > 0)
1104 std::cout << "============================== layer " << l << " / " << setup->GetNMaxLayer() << " layers" << std::endl;
1105 if (!setup->IsLayerOn(l,-1)){
1106 std::cout << "====> layer " << l << " not enabled" << std::endl;
1107 continue;
1108 }
1109 if (!calib->IsLayerEnabled(l,-1)){
1110 std::cout << "====> layer " << l << " all channels masked" << std::endl;
1111 continue;
1112 }
1113 PlotTriggerPrim2ModLayer (canvasMulti,padMulti, legPlace_X, legPlace_Y, relTextSize, textSize,
1114 spectra, avMip, facLow, facHigh, xPMin, xPMax, scaleYMax, l,
1115 Form("%s_Layer%02d.%s" ,nameOutputBase.Data(), l, suffix.Data()), currRunInfo);
1116 }
1117
1118 } else if ( detType == DetConf::Type::LargeTB){
1119 std::cout << "PlotTriggerPrim: this option hasn't been implemented yet!" << std::endl;
1120
1121
1122 } else if ( detType == DetConf::Type::Asic){
1123 std::cout << "PlotTriggerPrim: this option hasn't been implemented yet!" << std::endl;
1124 }
1125 }