Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:15:44

0001 #include "Calib.h"
0002 #include <iostream>
0003 #include <fstream>
0004 
0005 ClassImp(Calib);
0006 
0007 //*****************************************************************************************
0008 // CALIBRATION Getters by cell ID
0009 //*****************************************************************************************
0010 double Calib::GetPedestalMeanH(int cellID) const{
0011   //std::map<int, double>::const_iterator it= PedestalMeanH.find(cellID);
0012   //if(it!=PedestalMeanH.end()) return it->second;
0013   std::map<int, TileCalib>::const_iterator it= CaloCalib.find(cellID);
0014   if(it!=CaloCalib.end()) return it->second.PedestalMeanH;
0015   else return 9999;
0016 }
0017 
0018 double Calib::GetPedestalMeanL(int cellID) const{
0019   //std::map<int, double>::const_iterator it= PedestalMeanL.find(cellID);
0020   //if(it!=PedestalMeanL.end()) return it->second;
0021   std::map<int, TileCalib>::const_iterator it= CaloCalib.find(cellID);
0022   if(it!=CaloCalib.end()) return it->second.PedestalMeanL;
0023   else return 9999;
0024 }
0025 
0026 double Calib::GetPedestalSigH(int cellID) const{
0027   //std::map<int, double>::const_iterator it= PedestalSigH.find(cellID);
0028   //if(it!=PedestalSigH.end()) return it->second;
0029   std::map<int, TileCalib>::const_iterator it= CaloCalib.find(cellID);
0030   if(it!=CaloCalib.end()) return it->second.PedestalSigH;
0031   else return 9999;
0032 }
0033 double Calib::GetPedestalSigL(int cellID) const{
0034   //std::map<int, double>::const_iterator it= PedestalSigL.find(cellID);
0035   //if(it!=PedestalSigL.end()) return it->second;
0036   std::map<int, TileCalib>::const_iterator it= CaloCalib.find(cellID);
0037   if(it!=CaloCalib.end()) return it->second.PedestalSigL;
0038   else return 9999;
0039 }
0040 
0041 double Calib::GetScaleHigh(int cellID)const {
0042   std::map<int, TileCalib>::const_iterator it= CaloCalib.find(cellID);
0043   if(it!=CaloCalib.end()){
0044     if (it->second.ScaleH != -1000  && (BCcalc && it->second.BadChannel > 1)){
0045       return it->second.ScaleH;
0046     } else {
0047       return GetAverageScaleHigh();
0048     }
0049   } else return -1.;
0050 }
0051 
0052 double Calib::GetScaleWidthHigh(int cellID)const {
0053   //std::map<int, double>::const_iterator it=ScaleH.find(cellID);
0054   //if(it!=ScaleH.end()) return it->second;
0055   std::map<int, TileCalib>::const_iterator it= CaloCalib.find(cellID);
0056   if(it!=CaloCalib.end()) return it->second.ScaleWidthH;
0057   else return -1.;
0058 }
0059 
0060 double Calib::GetCalcScaleLow(int cellID) const {
0061   std::map<int, TileCalib>::const_iterator it= CaloCalib.find(cellID);
0062   if(it!=CaloCalib.end()){
0063     if (it->second.ScaleH != -1000 && it->second.LGHGCorr != -64  && (BCcalc && it->second.BadChannel > 1)){
0064       return it->second.ScaleH/it->second.LGHGCorr;
0065     } else if ( it->second.LGHGCorr != -64  && (BCcalc && it->second.BadChannel > 1)){
0066       return GetAverageScaleHigh()/it->second.LGHGCorr;
0067     } else if (it->second.ScaleH != -1000 && (BCcalc && it->second.BadChannel > 1)){
0068       return it->second.ScaleH/GetAverageLGHGCorr();
0069     } else {
0070       return GetAverageScaleHigh()/GetAverageLGHGCorr();
0071     }
0072   }
0073   else return -1.;
0074 }
0075 
0076 double Calib::GetScaleLow(int cellID) const {
0077   std::map<int, TileCalib>::const_iterator it= CaloCalib.find(cellID);
0078   if(it!=CaloCalib.end()) return it->second.ScaleL;
0079   else return -1.;
0080 }
0081 
0082 double Calib::GetScaleWidthLow(int cellID) const {
0083   std::map<int, TileCalib>::const_iterator it= CaloCalib.find(cellID);
0084   if(it!=CaloCalib.end()) return it->second.ScaleWidthL;
0085   else return -1.;
0086 }
0087 
0088 double Calib::GetScaleLGHGCorr(int cellID) const {
0089   std::map<int, TileCalib>::const_iterator it= CaloCalib.find(cellID);
0090   if(it!=CaloCalib.end()) return it->second.LGHGCorr;
0091   else return -1.;
0092 }
0093 
0094 double Calib::GetScaleHGLGCorr(int cellID) const {
0095   std::map<int, TileCalib>::const_iterator it= CaloCalib.find(cellID);
0096   if(it!=CaloCalib.end()) return it->second.HGLGCorr;
0097   else return -1.;
0098 }
0099 
0100 short Calib::GetBadChannel(int cellID) const {
0101   std::map<int, TileCalib>::const_iterator it= CaloCalib.find(cellID);
0102   if(it!=CaloCalib.end()) return it->second.BadChannel;
0103   else return -1.;
0104 }
0105 
0106 //*****************************************************************************************
0107 // CALIBRATION Getters by cell row, col, layer and module
0108 //*****************************************************************************************
0109 double Calib::GetPedestalMeanH(int row, int col, int lay, int mod=0) const{
0110   Setup* setup = Setup::GetInstance();
0111   int key=setup->GetCellID(row, col, lay, mod);
0112   return GetPedestalMeanH(key);
0113 }
0114 
0115 double Calib::GetPedestalMeanL(int row, int col, int lay, int mod=0) const{
0116   Setup* setup = Setup::GetInstance();
0117   int key=setup->GetCellID(row, col, lay, mod);
0118   return GetPedestalMeanL(key);
0119 }
0120 
0121 double Calib::GetPedestalSigH(int row, int col, int lay, int mod=0) const{
0122   Setup* setup = Setup::GetInstance();
0123   int key=setup->GetCellID(row, col, lay, mod);
0124   return GetPedestalSigH(key);
0125 }
0126 
0127 double Calib::GetPedestalSigL(int row, int col, int lay, int mod=0) const{
0128   Setup* setup = Setup::GetInstance();
0129   int key=setup->GetCellID(row, col, lay, mod);
0130   return GetPedestalSigL(key);
0131 }
0132 
0133 double Calib::GetScaleHigh(int row, int col, int lay, int mod=0)const{
0134   Setup* setup = Setup::GetInstance();
0135   int key=setup->GetCellID(row, col,lay,mod);
0136   return GetScaleHigh(key);
0137 }
0138 
0139 double Calib::GetScaleWidthHigh(int row, int col, int lay, int mod=0)const{
0140   Setup* setup = Setup::GetInstance();
0141   int key=setup->GetCellID(row, col,lay,mod);
0142   return GetScaleWidthHigh(key);
0143 }
0144 
0145 double Calib::GetScaleLow(int row, int col, int lay, int mod=0)const{
0146   Setup* setup = Setup::GetInstance();
0147   int key=setup->GetCellID(row, col, lay, mod);
0148   return GetScaleLow(key);
0149 }
0150 
0151 double Calib::GetCalcScaleLow(int row, int col, int lay, int mod=0)const{
0152   Setup* setup = Setup::GetInstance();
0153   int key=setup->GetCellID(row, col, lay, mod);
0154   return GetCalcScaleLow(key);
0155 }
0156 
0157 double Calib::GetScaleWidthLow(int row, int col, int lay, int mod=0)const{
0158   Setup* setup = Setup::GetInstance();
0159   int key=setup->GetCellID(row, col, lay, mod);
0160   return GetScaleWidthLow(key);
0161 }
0162 
0163 double Calib::GetScaleLGHGCorr(int row, int col, int lay, int mod=0)const{
0164   Setup* setup = Setup::GetInstance();
0165   int key=setup->GetCellID(row, col, lay, mod);
0166   return GetScaleLGHGCorr(key);
0167 }
0168 
0169 double Calib::GetScaleHGLGCorr(int row, int col, int lay, int mod=0)const{
0170   Setup* setup = Setup::GetInstance();
0171   int key=setup->GetCellID(row, col, lay, mod);
0172   return GetScaleHGLGCorr(key);
0173 }
0174 
0175 short Calib::GetBadChannel(int row, int col, int lay, int mod=0)const{
0176   Setup* setup = Setup::GetInstance();
0177   int key=setup->GetCellID(row, col, lay, mod);
0178   return GetBadChannel(key);
0179 }
0180 
0181 //*****************************************************************************************
0182 // CALIBRATION Average calculators
0183 //*****************************************************************************************
0184 double Calib::GetAveragePedestalMeanHigh()const{
0185   double avSc = 0;
0186   std::map<int, TileCalib>::const_iterator it;
0187   for(it=CaloCalib.begin(); it!=CaloCalib.end(); ++it){
0188     avSc += it->second.PedestalMeanH;
0189   }
0190   return avSc/CaloCalib.size();
0191 }
0192 
0193 double Calib::GetAverageScaleHigh( )const{
0194   double avSc   = 0;
0195   int notCalib  = 0;
0196   std::map<int, TileCalib>::const_iterator it;
0197   for(it=CaloCalib.begin(); it!=CaloCalib.end(); ++it){
0198     if (it->second.ScaleH == -1000 || (BCcalc && it->second.BadChannel < 2) ){
0199       notCalib++;
0200     } else {
0201       avSc += it->second.ScaleH;
0202     }
0203   }
0204   return avSc/(CaloCalib.size()-notCalib);
0205 }
0206 
0207 
0208 double Calib::GetAverageScaleHigh(int &active )const{
0209   double avSc   = 0;
0210   int notCalib  = 0;
0211   std::map<int, TileCalib>::const_iterator it;
0212   for(it=CaloCalib.begin(); it!=CaloCalib.end(); ++it){
0213     if (it->second.ScaleH == -1000 || (BCcalc && it->second.BadChannel < 2) ){
0214       notCalib++;
0215     } else {
0216       avSc += it->second.ScaleH;
0217     }
0218   }
0219   active=(CaloCalib.size()-notCalib);
0220   return avSc/(CaloCalib.size()-notCalib);
0221 }
0222 
0223 double Calib::GetAverageScaleWidthHigh()const{
0224   double avSc = 0;
0225   int notCalib  = 0;
0226   std::map<int, TileCalib>::const_iterator it;
0227   for(it=CaloCalib.begin(); it!=CaloCalib.end(); ++it){
0228     if (it->second.ScaleWidthH == -1000 || (BCcalc && it->second.BadChannel < 2) ){
0229       notCalib++;
0230     } else {
0231       avSc += it->second.ScaleWidthH;
0232     }
0233   }
0234   return avSc/(CaloCalib.size()-notCalib);
0235 }
0236 
0237 double Calib::GetAverageScaleLow()const{
0238   double avSc = 0;
0239   int notCalib  = 0;
0240   std::map<int, TileCalib>::const_iterator it;
0241   for(it=CaloCalib.begin(); it!=CaloCalib.end(); ++it){
0242     if (it->second.ScaleL == -1000 || (BCcalc && it->second.BadChannel < 2) ){
0243       notCalib++;
0244     } else {
0245       avSc += it->second.ScaleL;
0246     }
0247   }
0248   return avSc/(CaloCalib.size()-notCalib);
0249 }
0250 double Calib::GetAverageScaleWidthLow()const{
0251   double avSc = 0;
0252   int notCalib  = 0;
0253   std::map<int, TileCalib>::const_iterator it;
0254   for(it=CaloCalib.begin(); it!=CaloCalib.end(); ++it){
0255     if (it->second.ScaleWidthL == -1000 || (BCcalc && it->second.BadChannel < 2) ){
0256       notCalib++;
0257     } else {
0258       avSc += it->second.ScaleWidthL;
0259     }
0260   }
0261   return avSc/(CaloCalib.size()-notCalib);
0262 }
0263 
0264 double Calib::GetAverageLGHGCorr()const{
0265   double avSc = 0;
0266   int notCalib  = 0;
0267   std::map<int, TileCalib>::const_iterator it;
0268   for(it=CaloCalib.begin(); it!=CaloCalib.end(); ++it){
0269     if (it->second.LGHGCorr == -64. || (BCcalc && it->second.BadChannel < 2) ){
0270       notCalib++;
0271     } else {
0272       avSc += it->second.LGHGCorr;
0273     }
0274   }
0275   return avSc/(CaloCalib.size()-notCalib);
0276 }
0277 
0278 double Calib::GetAverageHGLGCorr()const{
0279   double avSc = 0;
0280   int notCalib  = 0;
0281   std::map<int, TileCalib>::const_iterator it;
0282   for(it=CaloCalib.begin(); it!=CaloCalib.end(); ++it){
0283     if (it->second.HGLGCorr == -64. || (BCcalc && it->second.BadChannel < 2) ){
0284       notCalib++;
0285     } else {
0286       avSc += it->second.HGLGCorr;
0287     }
0288   }
0289   return avSc/(CaloCalib.size()-notCalib);
0290 }
0291 
0292 
0293 int Calib::GetNumberOfChannelsWithBCflag( short bcflag )const{
0294   int nCh = 0;
0295   std::map<int, TileCalib>::const_iterator it;
0296   for(it=CaloCalib.begin(); it!=CaloCalib.end(); ++it){
0297     if (bcflag == it->second.BadChannel)
0298       nCh++;
0299   }
0300   return nCh;
0301 }
0302 
0303 
0304 //*****************************************************************************************
0305 // Getters for full calib objects
0306 //*****************************************************************************************
0307 TileCalib* Calib::GetTileCalib(int cellID){
0308   std::map<int, TileCalib>::iterator it= CaloCalib.find(cellID);
0309   if(it!=CaloCalib.end()){
0310     return &(it->second);
0311   }
0312   else {
0313     TileCalib acal;
0314     CaloCalib[cellID]=acal;
0315     return &(CaloCalib[cellID]);
0316   }
0317 }
0318 
0319 TileCalib* Calib::GetTileCalib(int row, int col, int lay, int mod=0){
0320   Setup* setup = Setup::GetInstance();
0321   int key=setup->GetCellID(row, col, lay, mod);
0322   return GetTileCalib(key);
0323 }
0324 
0325 //*****************************************************************************************
0326 // CALIBRATION Setters by cell ID
0327 //*****************************************************************************************
0328 void Calib::SetPedestalMeanH(double ped, int cellID){
0329   std::map<int, TileCalib>::iterator it= CaloCalib.find(cellID);
0330   if(it!=CaloCalib.end()){
0331     TileCalib acal;
0332     acal.PedestalMeanH=ped;
0333     CaloCalib[cellID]=acal;
0334   }
0335   else it->second.PedestalMeanH=ped;
0336 }
0337 
0338 void Calib::SetPedestalMeanL(double ped, int cellID){
0339   std::map<int, TileCalib>::iterator it= CaloCalib.find(cellID);
0340   if(it!=CaloCalib.end()){
0341     TileCalib acal;
0342     acal.PedestalMeanL=ped;
0343     CaloCalib[cellID]=acal;
0344   }
0345   else it->second.PedestalMeanL=ped;
0346 }
0347 
0348 void Calib::SetPedestalSigH(double ped, int cellID){
0349   std::map<int, TileCalib>::iterator it= CaloCalib.find(cellID);
0350   if(it!=CaloCalib.end()){
0351     TileCalib acal;
0352     acal.PedestalSigH=ped;
0353     CaloCalib[cellID]=acal;
0354   }
0355   else it->second.PedestalSigH=ped;
0356 }
0357 
0358 void Calib::SetPedestalSigL(double ped, int cellID){
0359   std::map<int, TileCalib>::iterator it= CaloCalib.find(cellID);
0360   if(it!=CaloCalib.end()){
0361     TileCalib acal;
0362     acal.PedestalSigL=ped;
0363     CaloCalib[cellID]=acal;
0364   }
0365   else it->second.PedestalSigL=ped;
0366 }
0367 
0368 void Calib::SetScaleHigh(double s, int cellID){
0369   std::map<int, TileCalib>::iterator it= CaloCalib.find(cellID);
0370   if(it!=CaloCalib.end()){
0371     TileCalib acal;
0372     acal.ScaleH=s;
0373     CaloCalib[cellID]=acal;
0374   }
0375   else it->second.ScaleH=s;
0376 }
0377 
0378 void Calib::SetScaleWidthHigh(double s, int cellID){
0379   std::map<int, TileCalib>::iterator it= CaloCalib.find(cellID);
0380   if(it!=CaloCalib.end()){
0381     TileCalib acal;
0382     acal.ScaleWidthH=s;
0383     CaloCalib[cellID]=acal;
0384   }
0385   else it->second.ScaleWidthH=s;
0386 }
0387 
0388 void Calib::SetScaleLow(double s, int cellID){
0389   std::map<int, TileCalib>::iterator it= CaloCalib.find(cellID);
0390   if(it!=CaloCalib.end()){
0391     TileCalib acal;
0392     acal.ScaleL=s;
0393     CaloCalib[cellID]=acal;
0394   }
0395   else it->second.ScaleL=s;
0396 }
0397 
0398 void Calib::SetScaleWidthLow(double s, int cellID){
0399   std::map<int, TileCalib>::iterator it= CaloCalib.find(cellID);
0400   if(it!=CaloCalib.end()){
0401     TileCalib acal;
0402     acal.ScaleWidthL=s;
0403     CaloCalib[cellID]=acal;
0404   }
0405   else it->second.ScaleWidthL=s;
0406 }
0407 
0408 void Calib::SetScaleLGHGCorr(double s, int cellID){
0409   std::map<int, TileCalib>::iterator it= CaloCalib.find(cellID);
0410   if(it!=CaloCalib.end()){
0411     TileCalib acal;
0412     acal.LGHGCorr=s;
0413     CaloCalib[cellID]=acal;
0414   }
0415   else it->second.LGHGCorr=s;
0416 }
0417 
0418 void Calib::SetScaleHGLGCorr(double s, int cellID){
0419   std::map<int, TileCalib>::iterator it= CaloCalib.find(cellID);
0420   if(it!=CaloCalib.end()){
0421     TileCalib acal;
0422     acal.HGLGCorr=s;
0423     CaloCalib[cellID]=acal;
0424   }
0425   else it->second.HGLGCorr=s;
0426 }
0427 
0428 void Calib::SetBadChannel(short s, int cellID){
0429   std::map<int, TileCalib>::iterator it= CaloCalib.find(cellID);
0430   if(it!=CaloCalib.end()){
0431     TileCalib acal;
0432     acal.BadChannel=s;
0433     CaloCalib[cellID]=acal;
0434   }
0435   else it->second.BadChannel=s;
0436 }
0437 
0438 
0439 //*****************************************************************************************
0440 // CALIBRATION Setters by cell row, col, layer and module
0441 //*****************************************************************************************
0442 void Calib::SetPedestalMeanH(double ped, int row, int col, int lay, int mod=0){
0443   Setup* setup = Setup::GetInstance();
0444   int key=setup->GetCellID(row,col,lay,mod);
0445   SetPedestalMeanH(ped,key);
0446 }
0447 void Calib::SetPedestalMeanL(double ped, int row, int col, int lay, int mod=0){
0448   Setup* setup = Setup::GetInstance();
0449   int key=setup->GetCellID(row,col,lay,mod);
0450   SetPedestalMeanL(ped,key);
0451 }
0452 void Calib::SetPedestalSigH(double ped, int row, int col, int lay, int mod=0){
0453   Setup* setup = Setup::GetInstance();
0454   int key=setup->GetCellID(row,col,lay,mod);
0455   SetPedestalSigH(ped,key);
0456 }
0457 void Calib::SetPedestalSigL(double ped, int row, int col, int lay, int mod=0){
0458   Setup* setup = Setup::GetInstance();
0459   int key=setup->GetCellID(row,col,lay,mod);
0460   SetPedestalSigL(ped,key);
0461 }
0462 
0463 void Calib::SetScaleHigh(double s, int row, int col, int lay, int mod=0){
0464   Setup* setup = Setup::GetInstance();
0465   int key=setup->GetCellID(row,col,lay,mod);
0466   SetScaleHigh(s,key);
0467 }
0468 
0469 void Calib::SetScaleWidthHigh(double s, int row, int col, int lay, int mod=0){
0470   Setup* setup = Setup::GetInstance();
0471   int key=setup->GetCellID(row,col,lay,mod);
0472   SetScaleWidthHigh(s,key);
0473 }
0474 
0475 void Calib::SetScaleLow(double s, int row, int col, int lay, int mod=0){
0476   Setup* setup = Setup::GetInstance();
0477   int key=setup->GetCellID(row,col,lay,mod);
0478   SetScaleLow(s,key);
0479 }
0480 
0481 void Calib::SetScaleWidthLow(double s, int row, int col, int lay, int mod=0){
0482   Setup* setup = Setup::GetInstance();
0483   int key=setup->GetCellID(row,col,lay,mod);
0484   SetScaleWidthLow(s,key);
0485 }
0486 
0487 void Calib::SetScaleLGHGCorr(double s, int row, int col, int lay, int mod=0){
0488   Setup* setup = Setup::GetInstance();
0489   int key=setup->GetCellID(row,col,lay,mod);
0490   SetScaleLGHGCorr(s,key);
0491 }
0492 
0493 void Calib::SetScaleHGLGCorr(double s, int row, int col, int lay, int mod=0){
0494   Setup* setup = Setup::GetInstance();
0495   int key=setup->GetCellID(row,col,lay,mod);
0496   SetScaleHGLGCorr(s,key);
0497 }
0498 
0499 void Calib::SetBadChannel(short s, int row, int col, int lay, int mod=0){
0500   Setup* setup = Setup::GetInstance();
0501   int key=setup->GetCellID(row,col,lay,mod);
0502   SetBadChannel(s,key);
0503 }
0504 
0505 
0506 //*****************************************************************************************
0507 // CALIBRATION Getters for global properties
0508 //*****************************************************************************************
0509 int Calib::GetRunNumber(void){
0510   return RunNumber;
0511 }
0512 
0513 const TTimeStamp* Calib::GetBeginRunTime(void) const{
0514   return &BeginRunTime;
0515 }
0516 
0517 double Calib::GetVop(void){
0518   return Vop;
0519 }
0520 
0521 double Calib::GetVov(void){
0522   return Vov;
0523 }
0524 
0525 bool Calib::GetBCCalib(void){
0526   return BCcalc;
0527 }
0528 
0529 //*****************************************************************************************
0530 // CALIBRATION Setters for global properties
0531 //*****************************************************************************************
0532 void Calib::SetRunNumber(int r){
0533   RunNumber=r;
0534 }
0535 
0536 void Calib::SetBeginRunTime(TTimeStamp t){
0537   BeginRunTime=t;
0538 }
0539 
0540 void Calib::SetVop(double v){
0541   Vop=v;
0542 }
0543 
0544 void Calib::SetVov(double v){
0545   Vov=v;
0546 }
0547 
0548 void Calib::SetBCCalib(bool b){
0549   BCcalc=b;
0550 }
0551 
0552 
0553 void Calib::PrintGlobalInfo(){
0554   std::cout << "********************************************************************************************************" << std::endl;
0555   std::cout << "Calib info:\n \t RunNr: " << GetRunNumber() << "\t start time:" << GetBeginRunTime() << "\t Vop: " << GetVop() << "\t Vov: "<< GetVov() << "\t BC calib set: " << GetBCCalib() << std::endl;  
0556   std::cout << "********************************************************************************************************" << std::endl;
0557 }
0558 
0559 
0560 void Calib::PrintCalibToFile(TString filename){
0561   std::fstream fFileCalibOut;
0562   std::cout << "********************************************************************************************************" << std::endl;
0563   std::cout << "Printing calib info to: " << filename.Data() << std::endl;
0564   std::cout << "********************************************************************************************************" << std::endl;
0565   fFileCalibOut.open(filename.Data(), std::ios::out);
0566   fFileCalibOut << "#****************************************************************************************************************************************************************************************************************" << std::endl;
0567   fFileCalibOut << "#Calib info:\n \t RunNr: " << GetRunNumber() << "\t start time:" << GetBeginRunTime() << "\t Vop: " << GetVop() << "\t Vov: "<< GetVov() << "\t BC calib set: " << GetBCCalib() << std::endl;  
0568   fFileCalibOut << "#****************************************************************************************************************************************************************************************************************" << std::endl;
0569   Setup* setup = Setup::GetInstance();
0570 
0571   TString head = Form("#cellID\tlayer\trow\tcolumn\tmodule\tped mean H\tped sig H\tped mean L\tped sig L\tmip Scale H\tmip Width H\tmip Scale L\tmip Width L\tLG-HG\tHG-LG\tBC");  
0572   fFileCalibOut << head.Data() << std::endl;
0573   fFileCalibOut << "#****************************************************************************************************************************************************************************************************************" << std::endl;
0574   std::map<int, TileCalib>::const_iterator it;
0575   for(it=CaloCalib.begin(); it!=CaloCalib.end(); ++it){
0576       TString outSt = "";
0577       outSt = Form("%d\t%d\t%d\t%d\t%d\t%f\t%f\t%f\t%f\t%f\t%f\t%f\t%f\t%f\t%f\t%d",  
0578                    it->first, setup->GetLayer(it->first), setup->GetRow(it->first), setup->GetColumn(it->first), setup->GetModule(it->first), 
0579                    it->second.PedestalMeanH, it->second.PedestalSigH,
0580                    it->second.PedestalMeanL, it->second.PedestalSigL, 
0581                    it->second.ScaleH, it->second.ScaleWidthH,
0582                    it->second.ScaleL, it->second.ScaleWidthL,
0583                    it->second.LGHGCorr, it->second.HGLGCorr, 
0584                    it->second.BadChannel);
0585     fFileCalibOut << outSt.Data() << std::endl;
0586   }
0587   fFileCalibOut.close();
0588 }