]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSQASSDDataMakerRec.cxx
New plots for trending injector efficiencies (Melinda)
[u/mrichter/AliRoot.git] / ITS / AliITSQASSDDataMakerRec.cxx
index 83d466b52b3baa0589bef8f52c3a42d1e1ab0a85..17a8d0f4a491ab053eb6282a9100e015d61bcd30 100644 (file)
@@ -138,7 +138,7 @@ fCDBManager(0) {
     }
   }
 }
-
+/*
 //____________________________________________________________________________ 
 AliITSQASSDDataMakerRec::AliITSQASSDDataMakerRec(const AliITSQASSDDataMakerRec& qadm) :
 TObject(),
@@ -169,7 +169,7 @@ AliITSQASSDDataMakerRec& AliITSQASSDDataMakerRec::operator = (const AliITSQASSDD
   new(this) AliITSQASSDDataMakerRec(qac);
   return *this;
 }
-
+*/
 //__________________________________________________________________
 AliITSQASSDDataMakerRec::~AliITSQASSDDataMakerRec() {
   // destructor
@@ -600,7 +600,7 @@ Int_t AliITSQASSDDataMakerRec::InitRaws() {
     fHistSSDOccupancyLayer5->GetZaxis()->SetRangeUser(0.0,100.0);
     Char_t fLabel[3];
     for(Int_t iBin = 1; iBin < fgkSSDMODULESPERLADDERLAYER5 + 1; iBin++){
-      sprintf(fLabel,"%d",iBin);
+      snprintf(fLabel,2,"%d",iBin);
       fHistSSDOccupancyLayer5->GetXaxis()->SetBinLabel(iBin,fLabel);
     }
     fHistSSDOccupancyLayer5->SetStats(kFALSE);
@@ -615,7 +615,7 @@ Int_t AliITSQASSDDataMakerRec::InitRaws() {
                                             600,600+fgkSSDLADDERSLAYER6);
     fHistSSDOccupancyLayer6->GetZaxis()->SetRangeUser(0.0,100.0);
     for(Int_t iBin = 1; iBin < fgkSSDMODULESPERLADDERLAYER6 + 1; iBin++){
-      sprintf(fLabel,"%d",iBin);
+      snprintf(fLabel,2,"%d",iBin);
       fHistSSDOccupancyLayer6->GetXaxis()->SetBinLabel(iBin,fLabel);
     }
     fHistSSDOccupancyLayer6->SetStats(kFALSE);
@@ -632,7 +632,7 @@ Int_t AliITSQASSDDataMakerRec::InitRaws() {
                                                      500,500+fgkSSDLADDERSLAYER5);  
     fHistSSDOccupancyThresholdLayer5->GetZaxis()->SetRangeUser(3.0,10.0);
     for(Int_t iBin = 1; iBin < fgkSSDMODULESPERLADDERLAYER5 + 1; iBin++){
-      sprintf(fLabel,"%d",iBin);
+      snprintf(fLabel,2,"%d",iBin);
       fHistSSDOccupancyThresholdLayer5->GetXaxis()->SetBinLabel(iBin,fLabel);
     }
     fHistSSDOccupancyThresholdLayer5->SetStats(kFALSE);
@@ -647,7 +647,7 @@ Int_t AliITSQASSDDataMakerRec::InitRaws() {
                                                      600,600+fgkSSDLADDERSLAYER6);
     fHistSSDOccupancyThresholdLayer6->GetZaxis()->SetRangeUser(3.0,10.0);
     for(Int_t iBin = 1; iBin < fgkSSDMODULESPERLADDERLAYER6 + 1; iBin++){
-      sprintf(fLabel,"%d",iBin);
+      snprintf(fLabel,2,"%d",iBin);
       fHistSSDOccupancyThresholdLayer6->GetXaxis()->SetBinLabel(iBin,fLabel);
     }
     fHistSSDOccupancyThresholdLayer6->SetStats(kFALSE);
@@ -664,7 +664,7 @@ Int_t AliITSQASSDDataMakerRec::InitRaws() {
                                                    500,500+fgkSSDLADDERSLAYER5);  
     fHistSSDAverageOccupancyLayer5->GetZaxis()->SetRangeUser(0.0,5.0);
     for(Int_t iBin = 1; iBin < fgkSSDMODULESPERLADDERLAYER5 + 1; iBin++){
-      sprintf(fLabel,"%d",iBin);
+      snprintf(fLabel,2,"%d",iBin);
       fHistSSDAverageOccupancyLayer5->GetXaxis()->SetBinLabel(iBin,fLabel);
     }
     fHistSSDAverageOccupancyLayer5->SetStats(kFALSE);
@@ -679,7 +679,7 @@ Int_t AliITSQASSDDataMakerRec::InitRaws() {
                                                    600,600+fgkSSDLADDERSLAYER6);
     fHistSSDAverageOccupancyLayer6->GetZaxis()->SetRangeUser(0.0,5.0);
     for(Int_t iBin = 1; iBin < fgkSSDMODULESPERLADDERLAYER6 + 1; iBin++){
-      sprintf(fLabel,"%d",iBin);
+      snprintf(fLabel,2,"%d",iBin);
       fHistSSDAverageOccupancyLayer6->GetXaxis()->SetBinLabel(iBin,fLabel);
     }
     fHistSSDAverageOccupancyLayer6->SetStats(kFALSE);
@@ -894,7 +894,12 @@ Int_t AliITSQASSDDataMakerRec::MakeRaws(AliRawReader* rawReader) {
        " - LDC: "<<rawReader->GetLDCId()<<
        " - Size: "<<rawReader->GetDataSize()<<
        " - Equipment size: "<<rawReader->GetEquipmentSize()<<endl;*/
-      gSizePerDDL[rawReader->GetDDLID()] = rawReader->GetDataSize();
+      Int_t ddlid = rawReader->GetDDLID();
+      if(ddlid<0){
+       AliError("GetDDLID returns a negative value");
+       continue;
+      }
+      gSizePerDDL[ddlid] = rawReader->GetDataSize();
       //gSizePerLDC[rawReader->GetLDCId()-8] = rawReader->GetDataSize();
       AliITSgeomTGeo::GetModuleId(gSSDStream.GetModuleID(),gLayer,gLadder,gModule);
       gHistPosition = (gLayer == 5) ? ((gLadder - 1)*fgkSSDMODULESPERLADDERLAYER5 + gModule - 1) : ((gLadder - 1)*fgkSSDMODULESPERLADDERLAYER6 + gModule + fgkSSDMODULESLAYER5 - 1);
@@ -1122,9 +1127,9 @@ void AliITSQASSDDataMakerRec::MonitorOCDBObjects() {
   //((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[specie]+fSSDRawsOffset-fSSDRawsDAOffset+3))->Reset();
   
   AliCDBEntry *entryBadChannelsSSD = fCDBManager->Get("ITS/Calib/BadChannelsSSD");
-  if(!entryBadChannelsSSD) 
-    AliError("OCDB entry for the bad channel list is not valid!"); 
-  AliITSBadChannelsSSDv2 *badchannelsSSD = (AliITSBadChannelsSSDv2 *)entryBadChannelsSSD->GetObject();
+  if(!entryBadChannelsSSD)AliError("OCDB entry for the bad channel list is not valid!"); 
+  AliITSBadChannelsSSDv2 *badchannelsSSD = NULL;
+  if(entryBadChannelsSSD)badchannelsSSD = (AliITSBadChannelsSSDv2 *)entryBadChannelsSSD->GetObject();
   if(!badchannelsSSD)
     AliError("Bad channel list object is not a valid AliITSBadChannelsSSD object!");
 
@@ -1142,25 +1147,26 @@ void AliITSQASSDDataMakerRec::MonitorOCDBObjects() {
     nPSideChannelsLayer6 = 0, nNSideChannelsLayer6 = 0;
 
     Int_t badChannel = 0;
-    for(Int_t j = 0; j < fgkNumberOfPSideStrips; j++) {
-      badChannel = (Int_t)(badchannelsSSD->GetBadChannelP(i,j));
-      if(badChannel != 0) {
-        if(layer == 5)
-          nPSideChannelsLayer5 += 1;
-        if(layer == 6)
-          nPSideChannelsLayer6 += 1;
-        nBadPSideChannels += 1;
-      }//badchannel flag != 0
-      badChannel = (Int_t)(badchannelsSSD->GetBadChannelN(i,j));
-      if(badChannel != 0) {
-        if(layer == 5)
-          nNSideChannelsLayer5 += 1;
-        if(layer == 6)
-          nNSideChannelsLayer6 += 1;
-nBadNSideChannels += 1;
-      }//badchannel flag != 0
-    }//loop over strips
-
+    if(badchannelsSSD){
+      for(Int_t j = 0; j < fgkNumberOfPSideStrips; j++) {
+       badChannel = (Int_t)(badchannelsSSD->GetBadChannelP(i,j));
+       if(badChannel != 0) {
+         if(layer == 5)
+           nPSideChannelsLayer5 += 1;
+         if(layer == 6)
+           nPSideChannelsLayer6 += 1;
+         nBadPSideChannels += 1;
+       }//badchannel flag != 0
+       badChannel = (Int_t)(badchannelsSSD->GetBadChannelN(i,j));
+       if(badChannel != 0) {
+         if(layer == 5)
+           nNSideChannelsLayer5 += 1;
+         if(layer == 6)
+           nNSideChannelsLayer6 += 1;
+         nBadNSideChannels += 1;
+       }//badchannel flag != 0
+      }//loop over strips
+    }
 
     //cout << "Bad channels P side module " << module << ": " << nBadPSideChannels << endl;
     //cout << "Bad channels N side module " << module << ": " << nBadNSideChannels << endl;
@@ -1541,8 +1547,9 @@ Int_t AliITSQASSDDataMakerRec::MakeRecPoints(TTree *clustersTree)
   Int_t rv = 0 ; 
   Int_t gLayer = 0, gLadder = 0, gModule = 0;
   Int_t lLadderLocationY = 0;
+  TClonesArray *recpoints = NULL;
   AliITSRecPointContainer* rpcont=AliITSRecPointContainer::Instance();
-  TClonesArray *recpoints = rpcont->FetchClusters(0,clustersTree); 
+  rpcont->FetchClusters(0,clustersTree); 
   if(!rpcont->GetStatusOK() || !rpcont->IsSSDActive()){
     AliError("can't get SSD clusters !");
     return rv;
@@ -1554,7 +1561,9 @@ Int_t AliITSQASSDDataMakerRec::MakeRecPoints(TTree *clustersTree)
   Int_t npoints = 0;      
   Float_t cluglo[3]={0.,0.,0.}; 
   //printf("*-*-*-*-*-*-*---*-*-*-------*-*-*-*-*-*-***************AliITSQASSDataMakerRec::MakeRecpoints STEP1 \n");
-  Int_t firMod = AliITSgeomTGeo::GetModuleIndex(5,1,1);
+  // AliITSgeomTGeo::GetModuleIndex() issues an error in case the arguments
+  // are illegal and returns -1
+  Int_t firMod = TMath::Max(0,AliITSgeomTGeo::GetModuleIndex(5,1,1));
   Int_t lasMod =  AliITSgeomTGeo::GetNModules();
   for(Int_t module = firMod; module < lasMod; module++){
     recpoints = rpcont->UncheckedGetClusters(module);