LCOV - code coverage report
Current view: top level - FMD/FMDrec - AliFMDQADataMakerRec.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 7 261 2.7 %
Date: 2016-06-14 17:26:59 Functions: 3 24 12.5 %

          Line data    Source code
       1             : /**************************************************************************
       2             :  * Copyright(c) 2004, ALICE Experiment at CERN, All rights reserved. *
       3             :  *                                                                        *
       4             :  * Author: The ALICE Off-line Project.                                    *
       5             :  * Contributors are mentioned in the code where appropriate.              *
       6             :  *                                                                        *
       7             :  * Permission to use, copy, modify and distribute this software and its   *
       8             :  * documentation strictly for non-commercial purposes is hereby granted   *
       9             :  * without fee, provided that the above copyright notice appears in all   *
      10             :  * copies and that both the copyright notice and this permission notice   *
      11             :  * appear in the supporting documentation. The authors make no claims     *
      12             :  * about the suitability of this software for any purpose. It is          *
      13             :  * provided "as is" without express or implied warranty.                  *
      14             :  **************************************************************************/
      15             : // --- ROOT system ---
      16             : #include <iostream>
      17             : #include <TClonesArray.h>
      18             : #include <TFile.h> 
      19             : #include <TH1F.h> 
      20             : #include <TH1I.h> 
      21             : #include <TH2I.h> 
      22             : #include <TGeoManager.h>
      23             : 
      24             : // --- AliRoot header files ---
      25             : #include "AliESDEvent.h"
      26             : #include "AliLog.h"
      27             : #include "AliGeomManager.h"
      28             : #include "AliFMDQADataMakerRec.h"
      29             : #include "AliFMDDigit.h"
      30             : #include "AliFMDRecPoint.h"
      31             : #include "AliQAChecker.h"
      32             : #include "AliESDFMD.h"
      33             : #include "AliFMDParameters.h"
      34             : #include "AliFMDRawReader.h"
      35             : #include "AliFMDReconstructor.h"
      36             : #include "AliRawReader.h"
      37             : #include "AliFMDAltroMapping.h"
      38             : #include "AliFMDDebug.h"
      39             : 
      40             : namespace {
      41             :   Int_t colors[3] = {kRed,kGreen,kBlue};
      42             : }
      43             : //_____________________________________________________________________
      44             : // This is the class that collects the QA data for the FMD during
      45             : // reconstruction.  
      46             : //
      47             : // The following data types are picked up:
      48             : // - rec points
      49             : // - esd data
      50             : // - raws
      51             : // Author : Hans Hjersing Dalsgaard, hans.dalsgaard@cern.ch
      52             : //_____________________________________________________________________
      53             : 
      54          12 : ClassImp(AliFMDQADataMakerRec)
      55             : #if 0
      56             : ; // For Emacs - do not delete!
      57             : #endif
      58             :            
      59             : //_____________________________________________________________________
      60             : AliFMDQADataMakerRec::AliFMDQADataMakerRec() 
      61           6 :   : AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kFMD), 
      62             :                       "FMD Quality Assurance Data Maker"),
      63           2 :     fRecPointsArray("AliFMDRecPoint", 1000), 
      64           2 :     fReconstructor(0),
      65           2 :     fUseReconstructor(true)
      66          10 : {
      67             :   // ctor
      68             :  
      69           4 : }
      70             : 
      71             : //_____________________________________________________________________
      72             : AliFMDQADataMakerRec::AliFMDQADataMakerRec(const AliFMDQADataMakerRec& qadm) 
      73           0 :   : AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kFMD), 
      74             :                       "FMD Quality Assurance Data Maker"),
      75           0 :     fRecPointsArray(qadm.fRecPointsArray), 
      76           0 :     fReconstructor(qadm.fReconstructor),
      77           0 :     fUseReconstructor(qadm.fUseReconstructor)
      78           0 : {
      79             :   // copy ctor 
      80             :   // Parameters: 
      81             :   //    qadm    Object to copy from
      82             :   
      83           0 : }
      84             : //_____________________________________________________________________
      85             : AliFMDQADataMakerRec& 
      86             : AliFMDQADataMakerRec::operator = (const AliFMDQADataMakerRec& qadm ) 
      87             : {
      88             :   // 
      89             :   // Assignment operator 
      90             :   // 
      91             :   // Parameters:
      92             :   //    qadm What to assign from 
      93             :   // 
      94             :   // Return:
      95             :   //    Reference to this
      96             :   //
      97           0 :   if (&qadm == this) return *this;
      98           0 :   fRecPointsArray   = qadm.fRecPointsArray;
      99           0 :   fReconstructor    = qadm.fReconstructor;
     100           0 :   fUseReconstructor = qadm.fUseReconstructor;
     101           0 :   return *this;
     102           0 : }
     103             : //_____________________________________________________________________
     104             : AliFMDQADataMakerRec::~AliFMDQADataMakerRec()
     105           0 : {
     106             :   // 
     107             :   // Destrcutor 
     108             :   // 
     109           0 : }
     110             : 
     111             : 
     112             : //_____________________________________________________________________ 
     113             : 
     114             : void 
     115             : AliFMDQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, 
     116             :                                          TObjArray ** list)
     117             : {
     118             :   // Detector specific actions at end of cycle
     119             :   // do the QA checking
     120           0 :   ResetEventTrigClasses(); // reset triggers list to select all histos
     121           0 :   AliLog::Message(5,"FMD: end of detector cycle",
     122             :                   "AliFMDQADataMakerRec","AliFMDQADataMakerRec",
     123             :                   "AliFMDQADataMakerRec::EndOfDetectorCycle",
     124             :                   "AliFMDQADataMakerRec.cxx",95);
     125           0 :   AliQAChecker::Instance()->Run(AliQAv1::kFMD, task, list);
     126           0 : }
     127             : 
     128             : //_____________________________________________________________________ 
     129             : TH1* AliFMDQADataMakerRec::MakeADCHist(UShort_t d, Char_t r, Short_t b)
     130             : {
     131           0 :   TString name("adc"); 
     132           0 :   TString title("ADC counts");
     133             :   Int_t   color = kRed+1; 
     134           0 :   if (d > 0) { 
     135           0 :     name.Append(Form("FMD%d%c", d, r));
     136           0 :     title.Append(Form(" in FMD%d%c", d, r));
     137           0 :     color = colors[d-1]+3+(r == 'I' || r == 'i' ? 0 : 1);
     138           0 :     if (b >= 0) {
     139           0 :       name.Append(Form("_0x%02x", b));
     140           0 :       title.Append(Form("[0x%02x]", b));
     141             :     }
     142             :   }
     143           0 :   TH1* hist = new TH1F(name, title,1024,0,1024);
     144           0 :   hist->SetXTitle("Amplitude [ADC counts]");
     145           0 :   hist->SetYTitle("Events [log]");
     146           0 :   hist->SetFillStyle(3001);
     147           0 :   hist->SetFillColor(color);
     148           0 :   hist->SetLineColor(color);
     149           0 :   hist->SetMarkerColor(color);
     150           0 :   hist->GetXaxis()->SetNdivisions(408,false);
     151           0 :   hist->SetDirectory(0);
     152             :   // hist->SetStats(0);
     153             : 
     154             :   return hist;
     155           0 : }
     156             : //_____________________________________________________________________ 
     157             : TH1* AliFMDQADataMakerRec::MakeELossHist(UShort_t d, Char_t r, Short_t b)
     158             : {
     159           0 :   TString name("eloss"); 
     160           0 :   TString title("Energy loss");
     161             :   Int_t   color = kBlue+1;
     162           0 :   if (d > 0) { 
     163           0 :     name.Append(Form("FMD%d%c", d, r));
     164           0 :     title.Append(Form(" in FMD%d%c", d, r));
     165           0 :     color = colors[d-1]+3+(r == 'I' || r == 'i' ? 0 : 1);
     166           0 :     if (b >= 0) {
     167           0 :       name.Append(Form("_0x%02x", b));
     168           0 :       title.Append(Form("[0x%02x]", b));
     169             :     }
     170             :   }
     171           0 :   TH1* hist = new TH1F(name, title,600,0, 15);
     172           0 :   hist->SetXTitle("#Delta/#Delta_{mip}");
     173           0 :   hist->SetYTitle("Events [log]");
     174           0 :   hist->SetFillStyle(3001);
     175           0 :   hist->SetFillColor(color);
     176           0 :   hist->SetLineColor(color);
     177           0 :   hist->SetMarkerColor(color);
     178           0 :   hist->Sumw2();
     179           0 :   hist->SetDirectory(0);
     180             :   // hist->SetStats(0);
     181             : 
     182             :   return hist;
     183           0 : }
     184             : 
     185             : 
     186             : //_____________________________________________________________________ 
     187             : void AliFMDQADataMakerRec::InitESDs()
     188             : {
     189             :   // create Digits histograms in Digits subdir
     190           0 :   Info("InitESDs", "Initializing ESDs");
     191             :   const Bool_t expert   = kTRUE ; 
     192             :   const Bool_t image    = kTRUE ; 
     193             :   
     194           0 :   TH1* hist = MakeELossHist();
     195           0 :   Add2ESDsList(hist, 0, !expert, image);
     196           0 :   ClonePerTrigClass(AliQAv1::kESDS); // this should be the last line    
     197           0 : }
     198             : 
     199             : //_____________________________________________________________________
     200             : void AliFMDQADataMakerRec::InitDigits()
     201             : {
     202             :   // create Digits histograms in Digits subdir
     203           0 :   Info("InitDigits", "Initializing Digits");
     204             :   const Bool_t expert   = kTRUE ; 
     205             :   const Bool_t image    = kTRUE ; 
     206             :   
     207           0 :   TH1* hist = MakeADCHist();
     208           0 :   Add2DigitsList(hist, 0, !expert, image);
     209           0 :   ClonePerTrigClass(AliQAv1::kDIGITS); // this should be the last line
     210           0 : }
     211             : 
     212             : //_____________________________________________________________________ 
     213             : void AliFMDQADataMakerRec::InitRecPoints()
     214             : {
     215             :   // create Reconstructed Points histograms in RecPoints subdir
     216           0 :   Info("InitRecPoints", "Initializing RecPoints");
     217             :   const Bool_t expert   = kTRUE ; 
     218             :   const Bool_t image    = kTRUE ; 
     219             : 
     220           0 :   TH1* hist = MakeELossHist();
     221           0 :   Add2RecPointsList(hist,0, !expert, image);
     222           0 :   ClonePerTrigClass(AliQAv1::kRECPOINTS); // this should be the last linea
     223           0 : }
     224             : 
     225             : //_____________________________________________________________________ 
     226             : void AliFMDQADataMakerRec::InitRaws()
     227             : {
     228             :   // create Raws histograms in Raws subdir  
     229           0 :   Info("InitRaws", "Initializing Raws");
     230             :   const Bool_t expert   = kTRUE ; // Flag - not the setting
     231             :   const Bool_t saveCorr = kTRUE ; // Flag - not setting
     232             :   const Bool_t image    = kTRUE ; // Flag - not the setting
     233           0 :   TH2I* hErrors = new TH2I("readoutErrors", "Read out errors", 3, .5, 3.5,
     234             :                            160, -.5, 159.5); 
     235           0 :   hErrors->GetXaxis()->SetBinLabel(1, "FMD1");
     236           0 :   hErrors->GetXaxis()->SetBinLabel(2, "FMD2");
     237           0 :   hErrors->GetXaxis()->SetBinLabel(3, "FMD3");
     238           0 :   hErrors->SetYTitle("# errors [log]");
     239           0 :   hErrors->SetZTitle("Events [log]");
     240           0 :   hErrors->SetDirectory(0);
     241           0 :   Add2RawsList(hErrors, 1, !expert, image, !saveCorr);
     242             :   //AliInfo(Form("Adding %30s to raw list @ %2d", hErrors->GetName(), 1));
     243             : 
     244           0 :   if (fUseReconstructor && !fReconstructor) {
     245             :     // Int_t oldDbg = AliLog::GetDebugLevel("FMD","");
     246             :     // AliLog::SetModuleDebugLevel("FMD", 5);
     247             : 
     248           0 :     if (!gGeoManager) {
     249           0 :       Info("InitRaws", "Loading the geometry");
     250           0 :       AliGeomManager::LoadGeometry();
     251           0 :     }
     252             : 
     253           0 :     fReconstructor = new AliFMDReconstructor();
     254           0 :     fReconstructor->SetDiagnose(false);
     255           0 :     fReconstructor->Init();
     256             :     // AliLog::SetModuleDebugLevel("FMD", oldDbg);
     257           0 :   }
     258             : 
     259           0 :   TH2* status = new TH2D("status", "Fit status per cycle", 
     260             :                           5, .5, 5.5, 4, -.5, 3.5);
     261           0 :   status->SetDirectory(0);
     262             :   // status->SetXTitle("Detector");
     263             :   // status->SetYTitle("Status");
     264           0 :   status->SetZTitle("N_{cycles} [LOG]");
     265           0 :   status->GetXaxis()->SetBinLabel(1, "FMD1i");
     266           0 :   status->GetXaxis()->SetBinLabel(2, "FMD2i");
     267           0 :   status->GetXaxis()->SetBinLabel(3, "FMD2o");
     268           0 :   status->GetXaxis()->SetBinLabel(4, "FMD3i");
     269           0 :   status->GetXaxis()->SetBinLabel(5, "FMD3o");
     270           0 :   status->GetYaxis()->SetBinLabel(1, "OK");
     271           0 :   status->GetYaxis()->SetBinLabel(2, "Problem");
     272           0 :   status->GetYaxis()->SetBinLabel(3, "Bad");
     273           0 :   status->GetYaxis()->SetBinLabel(4, "What the ...?");
     274           0 :   status->GetXaxis()->SetLabelSize(0.16);
     275           0 :   status->GetYaxis()->SetLabelSize(0.16);
     276           0 :   status->SetStats(0);
     277           0 :   Add2RawsList(status, GetHalfringIndex(4, 'i', 0, 0), 
     278             :                !expert, image, !saveCorr);
     279             :                
     280             :   TH1* hist;
     281             :   Int_t idx = 0;
     282           0 :   for(UShort_t d = 1; d<=3; d++) {
     283           0 :     UShort_t nR = (d == 1 ? 1 : 2); 
     284           0 :     for(UShort_t q = 0; q < nR; q++) {
     285           0 :       Char_t r = (q == 1 ? 'O' : 'I');
     286           0 :       hist = (fUseReconstructor ? 
     287           0 :               MakeELossHist(d, r, -1) : 
     288           0 :               MakeADCHist(d, r, -1));
     289             : 
     290           0 :       Int_t index1 = GetHalfringIndex(d, r, 0, 1);
     291           0 :       idx          = TMath::Max(index1, idx);
     292           0 :       Add2RawsList(hist, index1, !expert, image, !saveCorr);
     293             :       //AliInfo(Form("Adding %30s to raw list @ %2d", hist->GetName(), index1));
     294             :       
     295             :       // If we're using the reconstructor, do not make expert histograms 
     296           0 :       if (fUseReconstructor) continue;
     297             :       
     298           0 :       for(UShort_t b = 0; b <= 1; b++) {
     299             :         //Hexadecimal board numbers 0x0, 0x1, 0x10, 0x11;
     300           0 :         UShort_t board = (q == 1 ? 0 : 1) + b*16;
     301             : 
     302           0 :         hist = MakeADCHist(d, r, board);
     303           0 :         Int_t index2 = GetHalfringIndex(d, r, board/16,0);
     304           0 :         idx          = TMath::Max(index2, idx);
     305           0 :         Add2RawsList(hist, index2, expert, !image, !saveCorr);
     306             :         //AliInfo(Form("Adding %30s to raw list @ %2d",hist->GetName(),index2));
     307             :       }
     308           0 :     }
     309             :   }
     310             :   //
     311           0 :   ClonePerTrigClass(AliQAv1::kRAWS); // this should be the last line
     312           0 : }
     313             : 
     314             : #if 0
     315             : struct FillESDHist : public AliESDFMD::ForOne
     316             : {
     317             :   FillESDHist(AliFMDQADataMakerRec* m) : fM(m) {}
     318             :   FillESDHist(const FillESDHist& o) : fM(o.fM) {}
     319             :   FillESDHist& operator=(const FillESDHist& o) { fM = o.fM; return *this;  }
     320             :   Bool_t operator()(UShort_t, Char_t, UShort_t, UShort_t, Float_t m, Float_t) 
     321             :   {
     322             :     // Float_t mult = fmd->Multiplicity(det,ring,sec,strip);
     323             :     if(m == AliESDFMD::kInvalidMult) return true;
     324             :     
     325             :     fM->FillESDsData(0,m);
     326             :     return true;
     327             :   }
     328             :   AliFMDQADataMakerRec* fM;
     329             : };
     330             : #endif
     331             : 
     332             : //_____________________________________________________________________
     333             : void AliFMDQADataMakerRec::MakeESDs(AliESDEvent * esd)
     334             : {
     335             :   // 
     336             :   // Analyse ESD event
     337             :   // 
     338             :   // Parameters:
     339             :   //    esd ESD event
     340             :   //
     341           0 :   if(!esd) {
     342           0 :     AliError("FMD ESD object not found!!") ; 
     343           0 :     return;
     344             :   }
     345           0 :   AliFMDDebug(2, ("Will loop over ESD data and fill histogram"));
     346             : 
     347           0 :   AliESDFMD* fmd = esd->GetFMDData();
     348           0 :   if (!fmd) return;
     349             : 
     350             : #if 0
     351             :   FillESDHist f(this);
     352             :   fmd->ForEach(f);
     353             : #else
     354             : 
     355             : 
     356             : 
     357             :   // FIXME - we should use AliESDFMD::ForOne subclass to do this!
     358           0 :   for(UShort_t det=1;det<=3;det++) {
     359           0 :     UShort_t nrng = (det == 1 ? 1 : 2);
     360           0 :     for (UShort_t ir = 0; ir < nrng; ir++) {
     361           0 :       Char_t   ring = (ir == 0 ? 'I' : 'O');
     362           0 :       UShort_t nsec = (ir == 0 ? 20  : 40);
     363           0 :       UShort_t nstr = (ir == 0 ? 512 : 256);
     364           0 :       for(UShort_t sec =0; sec < nsec;  sec++)  {
     365           0 :         for(UShort_t strip = 0; strip < nstr; strip++) {
     366           0 :           Float_t mult = fmd->Multiplicity(det,ring,sec,strip);
     367           0 :           if(mult == AliESDFMD::kInvalidMult) continue;
     368             :           
     369           0 :           FillESDsData(0,mult);
     370           0 :         }
     371             :       }
     372             :     }
     373             :   }
     374             : #endif
     375           0 :   IncEvCountCycleESDs();
     376           0 :   IncEvCountTotalESDs();
     377           0 : }
     378             : 
     379             : 
     380             : //_____________________________________________________________________
     381             : void AliFMDQADataMakerRec::MakeDigits()
     382             : {
     383             :   // makes data from Digits  
     384           0 :   if(!fDigitsArray)  {
     385           0 :     AliError("FMD Digit object not found!!") ;
     386           0 :     return;
     387             :   }
     388             :   
     389           0 :   for(Int_t i=0;i<fDigitsArray->GetEntriesFast();i++) {
     390             :     //Raw ADC counts
     391           0 :     AliFMDDigit* digit = static_cast<AliFMDDigit*>(fDigitsArray->At(i));
     392           0 :     FillDigitsData(0,digit->Counts());
     393             :   }
     394           0 : }
     395             : 
     396             : //_____________________________________________________________________
     397             : void AliFMDQADataMakerRec::MakeDigits(TTree * digitTree)
     398             : {
     399             :   // 
     400             :   // Analyse digits
     401             :   // 
     402             :   // Parameters:
     403             :   //    digitTree Tree of digits
     404             :   //
     405           0 :   if (fDigitsArray) 
     406           0 :     fDigitsArray->Clear();
     407             :   else 
     408           0 :     fDigitsArray = new TClonesArray("AliFMDDigit", 1000);
     409             : 
     410           0 :   TBranch*      branch = digitTree->GetBranch("FMD");
     411           0 :   if (!branch) {
     412           0 :     AliWarning("FMD branch in Digit Tree not found") ; 
     413           0 :     return;
     414             :   } 
     415           0 :   branch->SetAddress(&fDigitsArray);
     416           0 :   branch->GetEntry(0); 
     417           0 :   MakeDigits();
     418             :   //
     419           0 :   IncEvCountCycleDigits();
     420           0 :   IncEvCountTotalDigits();
     421           0 : }
     422             : 
     423             : //_____________________________________________________________________
     424             : void AliFMDQADataMakerRec::MakeRaws(AliRawReader* rawReader)
     425             : {
     426             :   // 
     427             :   // Analyse raw 
     428             :   // 
     429             :   // Parameters:
     430             :   //    rawReader Raw reader
     431             :   //
     432           0 :   AliFMDRawReader fmdReader(rawReader,0);
     433           0 :   if (fDigitsArray) fDigitsArray->Clear();
     434           0 :   else              fDigitsArray = new TClonesArray("AliFMDDigit", 1000);
     435             :     
     436           0 :   TClonesArray* digitsAddress = fDigitsArray;
     437             :     
     438           0 :   rawReader->Reset();
     439             :     
     440           0 :   digitsAddress->Clear();
     441           0 :   fmdReader.ReadAdcs(digitsAddress);
     442             :   //
     443           0 :   FillRawsData(1,1, fmdReader.GetNErrors(0));
     444           0 :   FillRawsData(1,2, fmdReader.GetNErrors(1));
     445           0 :   FillRawsData(1,3, fmdReader.GetNErrors(2));
     446             : 
     447           0 :   if (fUseReconstructor) { 
     448           0 :     AliESDFMD* fmd = fReconstructor->GetESDObject();
     449           0 :     fmd->Clear();
     450             :     
     451             :     // AliLog::SetModuleDebugLevel("FMD", 15);
     452           0 :     fReconstructor->ProcessDigits(digitsAddress, fmdReader);
     453             : 
     454           0 :     if (!fmd) AliFatal("No ESD object from reconstructor");
     455             : 
     456           0 :     for(UShort_t det=1;det<=3;det++) {
     457           0 :       UShort_t nrng = (det == 1 ? 1 : 2);
     458           0 :       for (UShort_t ir = 0; ir < nrng; ir++) {
     459           0 :         Char_t   ring = (ir == 0 ? 'I' : 'O');
     460           0 :         UShort_t nsec = (ir == 0 ? 20  : 40);
     461           0 :         UShort_t nstr = (ir == 0 ? 512 : 256);
     462           0 :         for(UShort_t sec =0; sec < nsec;  sec++)  {
     463           0 :           for(UShort_t strip = 0; strip < nstr; strip++) {
     464           0 :             Float_t mult = fmd->Multiplicity(det,ring,sec,strip);
     465           0 :             if(mult == AliESDFMD::kInvalidMult) continue;
     466             :             
     467           0 :             Int_t index1 = GetHalfringIndex(det, ring, 0, 1);
     468           0 :             FillRawsData(index1,mult);
     469           0 :           }
     470             :         }
     471             :       }
     472             :     }
     473           0 :   }
     474             :   else {
     475           0 :     for(Int_t i=0;i<digitsAddress->GetEntriesFast();i++) {
     476             :       //Raw ADC counts
     477           0 :       AliFMDDigit*      digit = static_cast<AliFMDDigit*>(digitsAddress->At(i));
     478           0 :       UShort_t          det   = digit->Detector();
     479           0 :       Char_t            ring  = digit->Ring();
     480           0 :       UShort_t          sec   = digit->Sector();
     481             :       // UShort_t strip = digit->Strip();
     482           0 :       AliFMDParameters* pars  = AliFMDParameters::Instance();
     483           0 :       Short_t           board = pars->GetAltroMap()->Sector2Board(ring, sec);
     484             :       
     485           0 :       Int_t index1 = GetHalfringIndex(det, ring, 0, 1);
     486           0 :       FillRawsData(index1,digit->Counts());
     487           0 :       Int_t index2 = GetHalfringIndex(det, ring, board/16,0);
     488           0 :       FillRawsData(index2,digit->Counts());
     489             :     }
     490             :   }
     491             :   //
     492           0 :   IncEvCountCycleRaws();
     493           0 :   IncEvCountTotalRaws();
     494           0 : }
     495             : 
     496             : //_____________________________________________________________________
     497             : void AliFMDQADataMakerRec::MakeRecPoints(TTree* clustersTree)
     498             : {
     499             :   // makes data from RecPoints
     500             :   
     501           0 :    AliFMDParameters* pars = AliFMDParameters::Instance();
     502           0 :   fRecPointsArray.Clear();
     503           0 :   TBranch *fmdbranch = clustersTree->GetBranch("FMD");
     504           0 :   if (!fmdbranch) { 
     505           0 :     AliError("can't get the branch with the FMD recpoints !");
     506           0 :     return;
     507             :   }
     508             :   
     509           0 :   TClonesArray* RecPointsAddress = &fRecPointsArray;
     510             :   
     511           0 :   fmdbranch->SetAddress(&RecPointsAddress);
     512           0 :   fmdbranch->GetEntry(0);
     513           0 :   TIter next(RecPointsAddress) ; 
     514             :   AliFMDRecPoint * rp ; 
     515           0 :   while ((rp = static_cast<AliFMDRecPoint*>(next()))) {
     516           0 :     FillRecPointsData(0,rp->Edep()/pars->GetEdepMip());
     517             :   }
     518           0 :   IncEvCountCycleRecPoints();
     519           0 :   IncEvCountTotalRecPoints();
     520             :   //
     521           0 : }
     522             : 
     523             : //_____________________________________________________________________ 
     524             : void AliFMDQADataMakerRec::StartOfDetectorCycle()
     525             : {
     526             :   // Do an init on the reconstructor.  If we have the
     527             :   // same run nothing happens, but if we have a new run, we update our
     528             :   // parameters.
     529           0 :   if (fUseReconstructor && fReconstructor) fReconstructor->Init();
     530           0 :   if (fRawsQAList) {
     531           0 :     for (Int_t index = 0 ; index < AliRecoParam::kNSpecies ; index++) {
     532           0 :       if (!fRawsQAList[index]) continue;
     533           0 :       AliRecoParam::EventSpecie_t specie = AliRecoParam::ConvertIndex(index);
     534           0 :       if (specie == AliRecoParam::kCalib || specie == AliRecoParam::kCosmic) 
     535           0 :         continue;
     536             : 
     537           0 :       TIter    nextObject(fRawsQAList[index]);
     538             :       TObject* object = 0;
     539           0 :       while ((object = nextObject())) { 
     540           0 :         if (!object->InheritsFrom(TH1::Class())) continue;
     541           0 :         TH1* hist = static_cast<TH1*>(object);
     542           0 :         if (!hist->TestBit(kResetBit)) continue;
     543             :         
     544           0 :         AliInfoF("Resetting histogram %s", hist->GetName());
     545           0 :         hist->Reset("M");
     546           0 :         hist->SetBit(kResetBit, false);
     547           0 :       }
     548           0 :     }
     549           0 :   }
     550           0 : }
     551             : //_____________________________________________________________________ 
     552             : Int_t AliFMDQADataMakerRec::GetHalfringIndex(UShort_t det, 
     553             :                                              Char_t ring, 
     554             :                                              UShort_t board, 
     555             :                                              UShort_t monitor)
     556             : {
     557             :   // 
     558             :   // Get the half-ring index
     559             :   // 
     560             :   // Parameters:
     561             :   //    det      Detector
     562             :   //    ring     Ring
     563             :   //    board    Board number
     564             :   //    monitor  Monitor 
     565             :   // 
     566             :   // Return:
     567             :   //    Half ring index
     568             :   //  
     569           0 :   UShort_t iring = (ring == 'I' || ring == 'i' ? 1 : 0);
     570           0 :   Int_t    index = ((((det-1) & 0x3) << 3) | 
     571           0 :                     ((iring   & 0x1) << 2) |
     572           0 :                     ((board   & 0x1) << 1) | 
     573           0 :                     ((monitor & 0x1) << 0));
     574             : #if 0
     575             :   AliInfo(Form("d=%d, r=%c, b=%d, m=%d -> (%d<<3)|(%d<<2)|(%d<<1)|(%d<<0)=%2d",
     576             :                det, ring, board, monitor, (det-1) & 0x3, iring & 0x1, 
     577             :                board & 0x1, monitor & 0x1, index));
     578             : #endif
     579           0 :   return index-2;
     580             : }
     581             : //_____________________________________________________________________ 
     582             : void AliFMDQADataMakerRec::GetHalfringFromIndex(Int_t     idx, 
     583             :                                                 UShort_t& det, 
     584             :                                                 Char_t&   ring, 
     585             :                                                 UShort_t& board, 
     586             :                                                 UShort_t& monitor)
     587             : {
     588           0 :   det     = ((idx >> 3) & 0x3) + 1;
     589           0 :   ring    = ((idx >> 2) & 0x1) == 1 ? 'I' : 'O';
     590           0 :   board   = ((idx >> 1) & 0x1);
     591           0 :   monitor = ((idx >> 0) & 0x1);
     592           0 : }
     593             : 
     594             : 
     595             : //_____________________________________________________________________ 
     596             : 
     597             : 
     598             : //
     599             : // EOF
     600             : //

Generated by: LCOV version 1.11