CMS 3D CMS Logo

CSCNoiseMatrixAnalyzer.cc

Go to the documentation of this file.
00001 
00006 #include <iostream>
00007 #include <fstream>
00008 #include <vector>
00009 #include "string"
00010 
00011 #include <FWCore/Framework/interface/Frameworkfwd.h>
00012 #include <FWCore/Framework/interface/MakerMacros.h>
00013 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00014 #include "FWCore/Framework/interface/EDAnalyzer.h"
00015 #include "FWCore/Framework/interface/Event.h"
00016 #include "DataFormats/Common/interface/Handle.h"
00017 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00018 #include "FWCore/Framework/interface/EventSetup.h"
00019 #include "FWCore/Framework/interface/ESHandle.h"
00020 #include "DataFormats/CSCDigi/interface/CSCStripDigi.h"
00021 #include "DataFormats/CSCDigi/interface/CSCStripDigiCollection.h"
00022 #include "DataFormats/FEDRawData/interface/FEDRawData.h"
00023 #include "DataFormats/FEDRawData/interface/FEDNumbering.h"
00024 #include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h"
00025 #include "IORawData/CSCCommissioning/src/FileReaderDDU.h"
00026 #include "EventFilter/CSCRawToDigi/interface/CSCDDUEventData.h"
00027 #include "EventFilter/CSCRawToDigi/interface/CSCDCCEventData.h"
00028 #include "EventFilter/CSCRawToDigi/interface/CSCEventData.h"
00029 #include "EventFilter/CSCRawToDigi/interface/CSCDMBHeader.h"
00030 #include "OnlineDB/CSCCondDB/interface/CSCNoiseMatrixAnalyzer.h"
00032 //#include "OnlineDB/CSCCondDB/interface/CSCMap.h"
00034 #include "OnlineDB/CSCCondDB/interface/CSCMap1.h"
00035 
00036 CSCNoiseMatrixAnalyzer::CSCNoiseMatrixAnalyzer(edm::ParameterSet const& conf) {
00037   debug = conf.getUntrackedParameter<bool>("debug",false);
00038   eventNumber=0,evt=0,NChambers=0,Nddu=0,counterzero=0;
00039   strip=0,misMatch=0,myIndex=0,myNcham=-999;
00040   i_chamber=0,i_layer=0,reportedChambers=0;
00041   length=1,flagMatrix=-9;
00042   for(int k=0;k<CHAMBERS_ma;k++) cam[k].zero();
00043 
00044   for (int i=0;i<480;i++){
00045     newMatrix1[i] = 0.0;
00046     newMatrix2[i] = 0.0;
00047     newMatrix3[i] = 0.0;
00048     newMatrix4[i] = 0.0;
00049     newMatrix5[i] = 0.0;
00050     newMatrix6[i] = 0.0;
00051     newMatrix7[i] = 0.0;
00052     newMatrix8[i] = 0.0;
00053     newMatrix9[i] = 0.0;
00054     newMatrix10[i]= 0.0;
00055     newMatrix11[i]= 0.0;
00056     newMatrix12[i]= 0.0;
00057   
00058   }
00059 
00060   for (int i=0; i< CHAMBERS_ma; i++){
00061     size[i]=0;
00062   }
00063 }
00064 
00065 void CSCNoiseMatrixAnalyzer::analyze(edm::Event const& e, edm::EventSetup const& iSetup) {
00066   
00067   // These declarations create handles to the types of records that you want
00068   // to retrieve from event "e".
00069   //
00070   edm::Handle<CSCStripDigiCollection> strips;
00071   
00072   // Pass the handle to the method "getByType", which is used to retrieve
00073   // one and only one instance of the type in question out of event "e". If
00074   // zero or more than one instance exists in the event an exception is thrown.
00075   //
00076   e.getByLabel("cscunpacker","MuonCSCStripDigi",strips);
00077   
00078   edm::Handle<FEDRawDataCollection> rawdata;
00079   e.getByType(rawdata);
00080   counterzero=counterzero+1;
00081   evt=(counterzero+1)/2;
00082 
00083   for (int id=FEDNumbering::getCSCFEDIds().first;
00084        id<=FEDNumbering::getCSCFEDIds().second; ++id){ //for each of our DCCs
00085     
00087     const FEDRawData& fedData = rawdata->FEDData(id);
00088     if (fedData.size()){ 
00089       
00091       CSCDCCEventData dccData((short unsigned int *) fedData.data()); 
00092       
00093       const std::vector<CSCDDUEventData> & dduData = dccData.dduData(); 
00094          
00095       for (unsigned int iDDU=0; iDDU<dduData.size(); ++iDDU) { 
00096         
00098         const std::vector<CSCEventData> & cscData = dduData[iDDU].cscData();
00099         //exclude empty events with no DMB/CFEB data
00100         //      if(dduData[iDDU].cscData().size()==0) continue;
00101         //      if(dduData[iDDU].cscData().size() !=0) evt++;   
00102         
00103         Nddu=dduData.size();
00104         reportedChambers += dduData[iDDU].header().ncsc();
00105         NChambers = cscData.size();
00106         int repChambers = dduData[iDDU].header().ncsc();
00107         std::cout << " Reported Chambers = " << repChambers <<"   "<<NChambers<< std::endl;
00108         if (NChambers!=repChambers) { std::cout<< "misMatched size!!!" << std::endl; misMatch++;}
00109         if(NChambers > myNcham){
00110           myNcham=NChambers;
00111         }
00112 
00113         for (int i_chamber=0; i_chamber<NChambers; i_chamber++) { 
00114           
00115           for(int i_layer = 1; i_layer <= LAYERS_ma; ++i_layer) {
00116             std::vector<CSCStripDigi> digis = cscData[i_chamber].stripDigis(i_layer) ;
00117             const CSCDMBHeader * thisDMBheader = cscData[i_chamber].dmbHeader();
00118             
00119             if (cscData[i_chamber].dmbHeader() && thisDMBheader->cfebAvailable()){
00120               dmbID[i_chamber]   = cscData[i_chamber].dmbHeader()->dmbID(); 
00121               crateID[i_chamber] = cscData[i_chamber].dmbHeader()->crateID();
00122               if(crateID[i_chamber] == 255) continue; 
00123 
00124               for (unsigned int i=0; i<digis.size(); i++){
00125                 size[i_chamber]=digis.size();
00126                 int strip = digis[i].getStrip();
00127                 adc = digis[i].getADCCounts();
00128                 int tadc[8];
00129                 for(unsigned int j=0;j<adc.size();j++)tadc[j]=adc[j];
00130                 cam[i_chamber].add(i_layer-1,strip-1,tadc);
00131               }
00132             }
00133           }
00134         }
00135         tmp=corrmat; 
00136                 
00137         eventNumber++;
00138         edm::LogInfo ("CSCNoiseMatrixAnalyzer")  << "end of event number " << eventNumber<<" and non-zero event "<<evt;
00139       }
00140     }
00141   }
00142 }
00143 
00144 
00145 CSCNoiseMatrixAnalyzer::~CSCNoiseMatrixAnalyzer(){
00146   //get time of Run file for DB transfer
00147   filein.open("../test/CSCmatrix.cfg");
00148   filein.ignore(1000,'\n');
00149   
00150   while(filein != NULL){
00151     lines++;
00152     getline(filein,PSet);
00153     
00154     if (lines==2){
00155       name=PSet;  
00156       std::cout<<name<<std::endl;
00157     }
00158   }
00159   std::string::size_type runNameStart = name.find("\"",0);
00160   std::string::size_type runNameEnd   = name.find("raw",0);
00161   std::string::size_type rootStart    = name.find("SCA_Pedestals",0);
00162   int nameSize = runNameEnd+2-runNameStart;
00163   int myRootSize = rootStart-runNameStart+11;
00164   std::string myname= name.substr(runNameStart+1,nameSize);
00165   std::string myRootName= name.substr(runNameStart+1,myRootSize);
00166   std::string myRootEnd = ".root";
00167   std::string myASCIIFileEnd = ".dat";
00168   std::string runFile= myRootName;
00169   std::string myRootFileName = runFile+myRootEnd;
00170   std::string myASCIIFileName= runFile+myASCIIFileEnd;
00171   const char *myNewName=myRootFileName.c_str();
00172   const char *myFileName=myASCIIFileName.c_str();
00173     
00174   struct tm* clock;                         
00175   struct stat attrib;                       
00176   stat(myname.c_str(), &attrib);          
00177   clock = localtime(&(attrib.st_mtime));  
00178   std::string myTime=asctime(clock);
00179   std::ofstream myfile(myFileName,std::ios::out);
00180     
00181   //DB old map
00182   //cscmap *map = new cscmap();
00183   CSCMapItem::MapItem mapitem;
00184   cscmap1 *map = new cscmap1();
00185 
00186   CSCobject *cn = new CSCobject();
00187   condbon *dbon = new condbon();
00188   
00189   //root ntuple
00190   TCalibNoiseMatrixEvt calib_evt;
00191   TFile calibfile(myNewName, "RECREATE");
00192   TTree calibtree("Calibration","NoiseMatrix");
00193   calibtree.Branch("EVENT", &calib_evt, "elem[12]/F:strip/I:layer/I:cham/I:id/I:flagMatrix/I");
00194   
00195   //for (int myDDU; myDDU<Nddu; myDDU++){
00196   for (int i=0; i<myNcham; i++){
00197     
00198     //get chamber ID from DB mapping        
00199     int new_crateID = crateID[i];
00200     int new_dmbID   = dmbID[i];
00201     std::cout<<" Crate: "<<new_crateID<<" and DMB:  "<<new_dmbID<<std::endl;
00202    
00204     //map->crate_chamber(new_crateID,new_dmbID,&chamber_id,&chamber_num,&sector,&first_strip_index,&strips_per_layer,&chamber_index);
00206     map->cratedmb(new_crateID,new_dmbID,&mapitem);
00207     chamber_num=mapitem.chamberId;
00208     sector= mapitem.sector;
00209     first_strip_index=mapitem.stripIndex;
00210     strips_per_layer=mapitem.strips;
00211     chamber_index=mapitem.chamberId;
00212     chamber_type = mapitem.chamberLabel;
00213     
00214     std::cout<<"Data is for chamber:: "<<chamber_type<<"  "<< chamber_id<<" in sector:  "<<sector<<std::endl;
00215        
00216     calib_evt.id=chamber_num;
00217     for (int j=0; j<LAYERS_ma; j++){
00218       int layer_id=chamber_num+j+1;
00219       if(sector==-100)continue;
00220       cn->obj[layer_id].resize(size[i]);
00221       int counter=0;
00222 
00223       for (int k=0; k<size[i]; k++){
00224         for (int max=0; max<12;max++){
00225           tmp=cam[i].autocorrmat(j,k);
00226 
00227           //Use averages of matrix elements per chamber in case of HUGE values from calibratin run
00228           //ME+1/1 crates
00229           if (new_crateID==2 && new_dmbID<4 && tmp[0]>20.0)  tmp[0] =7.86675;
00230           if (new_crateID==2 && new_dmbID<4 && tmp[1]>20.0)  tmp[1] =2.07075;
00231           if (new_crateID==2 && new_dmbID<4 && tmp[2]>20.0)  tmp[2] =6.93875;
00232           if (new_crateID==2 && new_dmbID<4 && tmp[3]>20.0)  tmp[3] =1.42525;
00233           if (new_crateID==2 && new_dmbID<4 && tmp[4]>20.0)  tmp[4] =2.51025;
00234           if (new_crateID==2 && new_dmbID<4 && tmp[5]>20.0)  tmp[5] =7.93975;
00235           if (new_crateID==2 && new_dmbID<4 && tmp[6]>20.0)  tmp[6] =0.94725;
00236           if (new_crateID==2 && new_dmbID<4 && tmp[7]>20.0)  tmp[7] =2.39275;
00237           if (new_crateID==2 && new_dmbID<4 && tmp[8]>20.0)  tmp[8] =6.46475;
00238           if (new_crateID==2 && new_dmbID<4 && tmp[9]>20.0)  tmp[9] =1.86325;
00239           if (new_crateID==2 && new_dmbID<4 && tmp[10]>20.0) tmp[10]=2.08025;
00240           if (new_crateID==2 && new_dmbID<4 && tmp[11]>20.0) tmp[11]=6.67975;
00241 
00242           //ME+1/2
00243           if (new_crateID==2 && new_dmbID>3 && new_dmbID<8 && tmp[0]>20.0)  tmp[0] =9.118;
00244           if (new_crateID==2 && new_dmbID>3 && new_dmbID<8 && tmp[1]>20.0)  tmp[1] =3.884;
00245           if (new_crateID==2 && new_dmbID>3 && new_dmbID<8 && tmp[2]>20.0)  tmp[2] =7.771;
00246           if (new_crateID==2 && new_dmbID>3 && new_dmbID<8 && tmp[3]>20.0)  tmp[3] =1.8225;
00247           if (new_crateID==2 && new_dmbID>3 && new_dmbID<8 && tmp[4]>20.0)  tmp[4] =3.7505;
00248           if (new_crateID==2 && new_dmbID>3 && new_dmbID<8 && tmp[5]>20.0)  tmp[5] =8.597;
00249           if (new_crateID==2 && new_dmbID>3 && new_dmbID<8 && tmp[6]>20.0)  tmp[6] =1.651;
00250           if (new_crateID==2 && new_dmbID>3 && new_dmbID<8 && tmp[7]>20.0)  tmp[7] =2.5225;
00251           if (new_crateID==2 && new_dmbID>3 && new_dmbID<8 && tmp[8]>20.0)  tmp[8] =6.583;
00252           if (new_crateID==2 && new_dmbID>3 && new_dmbID<8 && tmp[9]>20.0)  tmp[9] =1.5055;
00253           if (new_crateID==2 && new_dmbID>3 && new_dmbID<8 && tmp[10]>20.0) tmp[10]=2.733;
00254           if (new_crateID==2 && new_dmbID>3 && new_dmbID<8 && tmp[11]>20.0) tmp[11]=6.988;
00255 
00256           //ME+1/3
00257           if (new_crateID==2 && new_dmbID>7 && tmp[0]>20.0)  tmp[0] =9.5245;
00258           if (new_crateID==2 && new_dmbID>7 && tmp[1]>20.0)  tmp[1] =3.2415;
00259           if (new_crateID==2 && new_dmbID>7 && tmp[2]>20.0)  tmp[2] =7.6265;
00260           if (new_crateID==2 && new_dmbID>7 && tmp[3]>20.0)  tmp[3] =1.7225;
00261           if (new_crateID==2 && new_dmbID>7 && tmp[4]>20.0)  tmp[4] =3.6075;
00262           if (new_crateID==2 && new_dmbID>7 && tmp[5]>20.0)  tmp[5] =8.7275;
00263           if (new_crateID==2 && new_dmbID>7 && tmp[6]>20.0)  tmp[6] =1.663;
00264           if (new_crateID==2 && new_dmbID>7 && tmp[7]>20.0)  tmp[7] =2.592;
00265           if (new_crateID==2 && new_dmbID>7 && tmp[8]>20.0)  tmp[8] =7.5685;
00266           if (new_crateID==2 && new_dmbID>7 && tmp[9]>20.0)  tmp[9] =1.7905;
00267           if (new_crateID==2 && new_dmbID>7 && tmp[10]>20.0) tmp[10]=2.409;
00268           if (new_crateID==2 && new_dmbID>7 && tmp[11]>20.0) tmp[11]=7.1495;
00269 
00270           //ME+2/1
00271           if (new_crateID==1 &&  new_dmbID<4 && !(tmp[0]<12.0 && tmp[0]>-10.0))   tmp[0] =9.06825;
00272           if (new_crateID==1 &&  new_dmbID<4 && !(tmp[1]<7.0 && tmp[1]>-10.0))    tmp[1] =3.32025;
00273           if (new_crateID==1 &&  new_dmbID<4 && !(tmp[2]<12.0 && tmp[2]>-10.0))   tmp[2] =7.52925;
00274           if (new_crateID==1 &&  new_dmbID<4 && !(tmp[3]<8.0 && tmp[3]>-10.0))    tmp[3] =3.66125;
00275           if (new_crateID==1 &&  new_dmbID<4 && !(tmp[4]<8.0 && tmp[4]>-10.0))    tmp[4] =3.39125;
00276           if (new_crateID==1 &&  new_dmbID<4 && !(tmp[5]<14.0 && tmp[5]>-10.0))   tmp[5] =9.97625;
00277           if (new_crateID==1 &&  new_dmbID<4 && !(tmp[6]<5.0 && tmp[6]>-10.0))    tmp[6] =1.32725;
00278           if (new_crateID==1 &&  new_dmbID<4 && !(tmp[7]<7.0 && tmp[7]>-10.0))    tmp[7] =3.99025;
00279           if (new_crateID==1 &&  new_dmbID<4 && !(tmp[8]<12.0 && tmp[8]>-10.0))   tmp[8] =8.10125;
00280           if (new_crateID==1 &&  new_dmbID<4 && !(tmp[9]<6.0 && tmp[9]>-10.0))    tmp[9] =2.56456;
00281           if (new_crateID==1 &&  new_dmbID<4 && !!(tmp[10]<7.0 && tmp[10]>-10.0))   tmp[10]=2.96625;
00282           if (new_crateID==1 &&  new_dmbID<4 && (tmp[11]<11.0 && tmp[11]>-10.0))  tmp[11]=7.30925;
00283 
00284           //ME+2/2
00285           if (new_crateID==1 &&  new_dmbID>3 && !(tmp[0]<21.0 && tmp[0]>-10.0))   tmp[0] =16.7442;
00286           if (new_crateID==1 &&  new_dmbID>3 && !(tmp[1]<12.0 && tmp[1]>-10.0))   tmp[1] =7.96925;
00287           if (new_crateID==1 &&  new_dmbID>3 && !(tmp[2]<18.0 && tmp[2]>-10.0))   tmp[2] =14.1643;
00288           if (new_crateID==1 &&  new_dmbID>3 && !(tmp[3]<9.0 && tmp[3]>-10.0))   tmp[3] =4.67975;
00289           if (new_crateID==1 &&  new_dmbID>3 && !(tmp[4]<12.0 && tmp[4]>-10.0))   tmp[4] =8.44075;
00290           if (new_crateID==1 &&  new_dmbID>3 && !(tmp[5]<21.0 && tmp[5]>-10.0))   tmp[5] =17.2243;
00291           if (new_crateID==1 &&  new_dmbID>3 && !(tmp[6]<8.0 && tmp[6]>-10.0))    tmp[6] =3.68575;
00292           if (new_crateID==1 &&  new_dmbID>3 && !(tmp[7]<12.0 && tmp[7]>-10.0))   tmp[7] =7.48825;
00293           if (new_crateID==1 &&  new_dmbID>3 && !(tmp[8]<19.0 && tmp[8]>-10.0))   tmp[8] =14.4902;
00294           if (new_crateID==1 &&  new_dmbID>3 && !(tmp[9]<9.0 && tmp[9]>-10.0))    tmp[9] =4.4482;
00295           if (new_crateID==1 &&  new_dmbID>3 && !(tmp[10]<11.0 && tmp[10]>-10.0))  tmp[10]=6.47875;
00296           if (new_crateID==1 &&  new_dmbID>3 && !(tmp[11]<19.0 && tmp[11]>-10.0))  tmp[11]=14.6733;       
00297 
00298           //ME+3/1
00299           if (new_crateID==0 &&  new_dmbID<4 && tmp[0]>13.0)   tmp[0] =9.3495;
00300           if (new_crateID==0 &&  new_dmbID<4 && tmp[1]>8.0)    tmp[1] =3.529;
00301           if (new_crateID==0 &&  new_dmbID<4 && tmp[2]>13.0)   tmp[2] =7.8715;
00302           if (new_crateID==0 &&  new_dmbID<4 && tmp[3]>8.0)    tmp[3] =3.8155;
00303           if (new_crateID==0 &&  new_dmbID<4 && tmp[4]>8.0)    tmp[4] =3.858;
00304           if (new_crateID==0 &&  new_dmbID<4 && tmp[5]>15.0)   tmp[5] =10.8205;
00305           if (new_crateID==0 &&  new_dmbID<4 && tmp[6]>6.0)    tmp[6] =1.8585;
00306           if (new_crateID==0 &&  new_dmbID<4 && tmp[7]>8.0)    tmp[7] =4.445;
00307           if (new_crateID==0 &&  new_dmbID<4 && tmp[8]>12.0)   tmp[8] =8.0175;
00308           if (new_crateID==0 &&  new_dmbID<4 && tmp[9]>7.0)    tmp[9] =3.29479;
00309           if (new_crateID==0 &&  new_dmbID<4 && tmp[10]>8.0)   tmp[10]=3.625;
00310           if (new_crateID==0 &&  new_dmbID<4 && tmp[11]>12.0)  tmp[11]=8.3895;
00311 
00312           //ME+3/2
00313           if (new_crateID==0 &&  new_dmbID>3 && tmp[0]>21.0)   tmp[0] =13.6193;
00314           if (new_crateID==0 &&  new_dmbID>3 && tmp[1]>12.0)   tmp[1] =5.91025;
00315           if (new_crateID==0 &&  new_dmbID>3 && tmp[2]>18.0)   tmp[2] =11.3842;
00316           if (new_crateID==0 &&  new_dmbID>3 && tmp[3]>9.0)    tmp[3] =3.31775;
00317           if (new_crateID==0 &&  new_dmbID>3 && tmp[4]>12.0)   tmp[4] =5.69775;
00318           if (new_crateID==0 &&  new_dmbID>3 && tmp[5]>21.0)   tmp[5] =11.6652;
00319           if (new_crateID==0 &&  new_dmbID>3 && tmp[6]>8.0)    tmp[6] =2.46175;
00320           if (new_crateID==0 &&  new_dmbID>3 && tmp[7]>12.0)   tmp[7] =4.48325;
00321           if (new_crateID==0 &&  new_dmbID>3 && tmp[8]>19.0)   tmp[8] =9.95725;
00322           if (new_crateID==0 &&  new_dmbID>3 && tmp[9]>9.0)    tmp[9] =2.10561;
00323           if (new_crateID==0 &&  new_dmbID>3 && tmp[10]>11.0)  tmp[10]=4.04625;
00324           if (new_crateID==0 &&  new_dmbID>3 && tmp[11]>19.0)  tmp[11]=9.51625;   
00325 
00326 
00327           if (tmp[max]>3.0 && tmp[max]<100.0) flagMatrix = 1; // ok
00328           if (tmp[max]>50.0)                  flagMatrix = 2; // warning too high
00329           if (tmp[max]<-15.0)                 flagMatrix = 3; // warning too low
00330           /*
00331           if (isnan(tmp[0]))                  tmp[0]   = 1000.0;
00332           if (isnan(tmp[1]))                  tmp[1]   = 1000.0;
00333           if (isnan(tmp[2]))                  tmp[2]   = 1000.0;
00334           if (isnan(tmp[3]))                  tmp[3]   = 1000.0;
00335           if (isnan(tmp[4]))                  tmp[4]   = 1000.0;
00336           if (isnan(tmp[5]))                  tmp[5]   = 1000.0;
00337           if (isnan(tmp[6]))                  tmp[6]   = 1000.0;
00338           if (isnan(tmp[7]))                  tmp[7]   = 1000.0;
00339           if (isnan(tmp[8]))                  tmp[8]   = 1000.0;
00340           if (isnan(tmp[9]))                  tmp[9]   = 1000.0;
00341           if (isnan(tmp[10]))                 tmp[10]  = 1000.0;
00342           if (isnan(tmp[11]))                 tmp[11]  = 1000.0;
00343           */
00344 
00345           calib_evt.elem[0] = tmp[0];
00346           calib_evt.elem[1] = tmp[1];
00347           calib_evt.elem[2] = tmp[2];
00348           calib_evt.elem[3] = tmp[3];
00349           calib_evt.elem[4] = tmp[4];
00350           calib_evt.elem[5] = tmp[5];
00351           calib_evt.elem[6] = tmp[6];
00352           calib_evt.elem[7] = tmp[7];
00353           calib_evt.elem[8] = tmp[8];
00354           calib_evt.elem[9] = tmp[9];
00355           calib_evt.elem[10] = tmp[10];
00356           calib_evt.elem[11] = tmp[11];
00357           calib_evt.strip   = k;
00358           calib_evt.layer   = j;
00359           calib_evt.cham    = i;
00360           calib_evt.flagMatrix = flagMatrix;
00361           
00362           calibtree.Fill();
00363           
00364           //std::cout<<"Chamber "<<i<<" Layer "<<j<<" strip "<<k<<" Matrix elements "<<tmp[max]<<std::endl;
00365           
00366           cn->obj[layer_id][k].resize(12);
00367           cn->obj[layer_id][k][0] = tmp[0];
00368           cn->obj[layer_id][k][1] = tmp[1];
00369           cn->obj[layer_id][k][2] = tmp[3];
00370           cn->obj[layer_id][k][3] = tmp[2];
00371           cn->obj[layer_id][k][4] = tmp[4];
00372           cn->obj[layer_id][k][5] = tmp[6];
00373           cn->obj[layer_id][k][6] = tmp[5];
00374           cn->obj[layer_id][k][7] = tmp[7];
00375           cn->obj[layer_id][k][8] = tmp[9];
00376           cn->obj[layer_id][k][9] = tmp[8];
00377           cn->obj[layer_id][k][10] = tmp[10];
00378           cn->obj[layer_id][k][11] = tmp[11];
00379           
00380         }
00381 
00382         counter++; 
00383         myIndex = first_strip_index+(counter-1);
00384         if (counter>size[i]*LAYERS_ma) counter=0;
00385         myfile<<layer_id<<"  "<<myIndex-1<<"  "<<tmp[0]<<"  "<<tmp[1]<<"  "<<tmp[3]<<"  "<<tmp[2]<<"  "<<tmp[4]<<"  "<<tmp[6]<<"  "<<tmp[5]<<"  "<<tmp[7]<<"  "<<tmp[9]<<"  "<<tmp[8]<<"  "<<tmp[10]<<"  "<<tmp[11]<<std::endl;
00386       }
00387     }
00388   }
00389   //}//myDDU
00390      
00391   //send data to DB
00392   dbon->cdbon_last_record("noisematrix",&record);
00393   std::cout<<"record "<<record<<" for run file "<<myname<<" saved "<<myTime<<std::endl;
00394   if(debug) dbon->cdbon_write(cn,"noisematrix",12,3498,myTime);
00395   std::cout<<"record "<<record<<" for run file "<<myname<<" saved "<<myTime<<std::endl;
00396   
00397   calibfile.Write();
00398   calibfile.Close();
00399 }

Generated on Tue Jun 9 17:40:41 2009 for CMSSW by  doxygen 1.5.4