]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSBeamTestDigSPD.cxx
Updated online raw data QA for the SSD - occupancy calculation per module (Panos)
[u/mrichter/AliRoot.git] / ITS / AliITSBeamTestDigSPD.cxx
index 9e666590517c5c8cad89ebcc0e40ab488454ca91..0ae2e74f8e1abfc538c523af4c05ce7cb9156dfc 100644 (file)
@@ -6,37 +6,36 @@
 //                                                //
 ////////////////////////////////////////////////////
 
+/* $Id$ */
 
 #include "AliITSdigitSPD.h"
-#include "AliRawReaderDate.h"
+#include "AliRawReader.h"
+#include "AliRawReader.h"
 #include "AliRawDataHeader.h"
 #include "AliITSRawStreamSPD.h"
 #include "AliITSBeamTestDigSPD.h"
-#include "AliITSBeamTest.h"
-
-
+#include "AliITSgeom.h"
+#include <TBranch.h>
+#include <TTree.h>
+#include "AliITSEventHeader.h"
 ClassImp(AliITSBeamTestDigSPD)
 
 
 
 //_____________________________________________________________
-  AliITSBeamTestDigSPD::AliITSBeamTestDigSPD(): AliITSBeamTestDig()
-{
+  AliITSBeamTestDigSPD::AliITSBeamTestDigSPD(): AliITSBeamTestDig(),
+fFlagHeader(0){
   //
   // Constructor
   //
-
-  
 }
 
 //_____________________________________________________________
-  AliITSBeamTestDigSPD::AliITSBeamTestDigSPD(const Text_t* name, const Text_t* title): AliITSBeamTestDig(name,title)
-{
+AliITSBeamTestDigSPD::AliITSBeamTestDigSPD(const Text_t* name, const Text_t* title): AliITSBeamTestDig(name,title),
+fFlagHeader(0){
   //
   // Constructor
   //
-
 }
 
 //__________________________________________________________________
@@ -55,33 +54,49 @@ void AliITSBeamTestDigSPD::Exec(Option_t* /*opt*/)
   //Reads raw data for SPD, fill SPD digits tree
 
 
-  TBranch* branch = fTreeD->GetBranch("ITSDigitSPD");
-  TClonesArray** newdigits = new TClonesArray*[fBt->GetNSPD()];
+  if(!fITSgeom){
+    Error("Exec","fITSgeom is null!");
+    return;
+  }
+  TBranch* branch = fTreeD->GetBranch("ITSDigitsSPD");
+
+  Int_t nsdd=0;
+  Int_t nspd=0;
+  Int_t nssd=0;
+  for(Int_t nlay=1;nlay<=fITSgeom->GetNlayers();nlay++){
+    for(Int_t nlad=1;nlad<=fITSgeom->GetNladders(nlay);nlad++){
+      for(Int_t ndet=1;ndet<=fITSgeom->GetNdetectors(nlay);ndet++){
+       Int_t index=fITSgeom->GetModuleIndex(nlay,nlad,ndet);
+       if(fITSgeom->GetModuleTypeName(index)=="kSPD") nspd++;
+       if(fITSgeom->GetModuleTypeName(index)=="kSDD") nsdd++;
+       if(fITSgeom->GetModuleTypeName(index)=="kSSD") nssd++;
+      }
+    }
+  }
+  Int_t maxn=nspd+nsdd+nssd;
 
-   Int_t* idig = new Int_t[fBt->GetNSPD()];
+  TClonesArray** newdigits = new TClonesArray*[maxn];
 
-  
 
-  for (Int_t idet =0; idet < fBt->GetNSPD();idet++){
+  Int_t* idig = new Int_t[maxn];
+
+  for (Int_t idet =0; idet <maxn;idet++){
      newdigits[idet]=new TClonesArray("AliITSdigitSPD");
      idig[idet]=0;  
    }
   
 
-
-  //cout <<"still here"<< endl;
-  AliITSRawStreamSPD str(fReaderDate);
+  AliITSRawStreamSPD str(fReader);
 
-  fReaderDate->SelectEquipment(17,211,211);
+  // fReader->SelectEquipment(17,0,19);
 
   while(str.Next()){  
 
-    const AliRawDataHeader* rdh = fReaderDate->GetDataHeader();
-    UChar_t blockAttributes = fReaderDate->GetBlockAttributes();     
-    UInt_t statusBits = fReaderDate->GetStatusBits();     
-    UInt_t orbitNumber = rdh->fEventID2;                        
-    UShort_t  bunchCross = rdh->fEventID1;      
+    const AliRawDataHeader* rdh = fReader->GetDataHeader();
+    UChar_t blockAttributes = fReader->GetBlockAttributes();     
+    UInt_t statusBits = fReader->GetStatusBits();     
+    UInt_t orbitNumber = rdh->GetEventID2();                    
+    UShort_t  bunchCross = rdh->GetEventID1();      
       // UInt_t DataSize = rdh->fSize;                               
       //UChar_t L1TrigType = rdh->fL1TriggerType;                            
       //UInt_t MiniEvId = rdh->GetMiniEventID();                             
@@ -96,15 +111,7 @@ void AliITSBeamTestDigSPD::Exec(Option_t* /*opt*/)
     Int_t row = str.GetRow();
     Int_t col = str.GetColumn();
 
-
-
-    //    if (modID == 0 || modID == 1) {
-    // cout <<"Mod ID " << modID  <<" Row : "<< row << "Col : " << col << endl; 
-     //}
-
-
-    const Int_t kdgt[3]={row,col,1};
-    
+    const Int_t kdgt[3]={col,row,1};
     //    newdigits = new TClonesArray*[fBt->GetNSPD()];
 
     new ((*newdigits[modID])[idig[modID]]) AliITSdigitSPD(kdgt);
@@ -122,32 +129,32 @@ void AliITSBeamTestDigSPD::Exec(Option_t* /*opt*/)
       //fITSHeader->SetSubDet(0,Subdets);
       //fITSHeader->SetL1TriggerType(0,L1TrigType);
 
-   // fITSHeader->SetOrbitNumberSPD(OrbitNumber);
-         //printf("Bunch Crossing  = %x\n ",BunchCross);
-     if ( blockAttributes != 0x3a ) {
-       Info("Exec","Block Attribs  = %x\n ",blockAttributes);
-     }  
+      //fITSHeader->SetOrbitNumberSPD(OrbitNumber);
+      //printf("Bunch Crossing  = %x\n ",BunchCross);
+      //if ( blockAttributes != 0x3a ) {
+      //Info("Exec","Block Attribs  = %x\n ",blockAttributes);
+      //}  
     
      
     
     } // while(str.Next());
     
 
-    for(Int_t n=0;n<fBt->GetNSPD();n++){
+    for(Int_t n=0;n<maxn;n++){
       branch->SetAddress(&newdigits[n]);
-      branch->Fill();  
+      branch->Fill(); 
+
    }
     
-    fTreeD->SetEntries(fBt->GetNSDD()+fBt->GetNSPD()+fBt->GetNSSD());
+    fTreeD->SetEntries(maxn);
   
        
-  
-    fReaderDate->Reset();
+    fReader->Reset();
     fTreeD->AutoSave();
    
 
-    for(Int_t n=0;n<fBt->GetNSPD();n++){
-    delete newdigits[n];
+    for(Int_t n=0;n<maxn;n++){
+      delete newdigits[n];
     }
 
     delete[] newdigits;