LCOV - code coverage report
Current view: top level - VZERO/VZEROsim - AliVZEROQADataMakerSim.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 69 97 71.1 %
Date: 2016-06-14 17:26:59 Functions: 10 14 71.4 %

          Line data    Source code
       1             : /**************************************************************************
       2             :  * Copyright(c) 1998-1999, 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             : 
      16             : 
      17             : /* $Id: AliVZEROQADataMakerSim.cxx 23123 2007-12-18 09:08:18Z hristov $ */
      18             : 
      19             : //---
      20             : //  Produces the data needed to calculate the quality assurance. 
      21             : //  All data must be mergeable objects.
      22             : //  Author : BC
      23             : //---
      24             : 
      25             : // --- ROOT system ---
      26             : #include <TClonesArray.h>
      27             : #include <TFile.h> 
      28             : #include <TH1F.h> 
      29             : #include <TDirectory.h>
      30             : // --- Standard library ---
      31             : 
      32             : // --- AliRoot header files ---
      33             : #include "AliESDEvent.h"
      34             : #include "AliLog.h"
      35             : #include "AliVZEROdigit.h" 
      36             : #include "AliVZEROhit.h"
      37             : #include "AliVZEROQADataMakerSim.h"
      38             : #include "AliQAChecker.h"
      39             : 
      40          12 : ClassImp(AliVZEROQADataMakerSim)
      41             :            
      42             : //____________________________________________________________________________ 
      43             :   AliVZEROQADataMakerSim::AliVZEROQADataMakerSim() : 
      44           3 :   AliQADataMakerSim(AliQAv1::GetDetName(AliQAv1::kVZERO), "VZERO Quality Assurance Data Maker")
      45             : 
      46           5 : {
      47             :   // constructor
      48             : 
      49             :   
      50           2 : }
      51             : 
      52             : //____________________________________________________________________________ 
      53             : AliVZEROQADataMakerSim::AliVZEROQADataMakerSim(const AliVZEROQADataMakerSim& qadm) :
      54           0 :   AliQADataMakerSim() 
      55           0 : {
      56             :   //copy constructor 
      57             : 
      58           0 :   SetName((const char*)qadm.GetName()) ; 
      59           0 :   SetTitle((const char*)qadm.GetTitle()); 
      60           0 : }
      61             : 
      62             : //__________________________________________________________________
      63             : AliVZEROQADataMakerSim& AliVZEROQADataMakerSim::operator = (const AliVZEROQADataMakerSim& qadm )
      64             : {
      65             :   // Assign operator.
      66           0 :   this->~AliVZEROQADataMakerSim();
      67           0 :   new(this) AliVZEROQADataMakerSim(qadm);
      68           0 :   return *this;
      69           0 : }
      70             : //____________________________________________________________________________
      71             : void AliVZEROQADataMakerSim::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)
      72             : {
      73             :   //Detector specific actions at end of cycle
      74             :   // do the QA checking
      75          18 :   ResetEventTrigClasses();
      76           9 :   AliQAChecker::Instance()->Run(AliQAv1::kVZERO, task, list) ;
      77           9 : }
      78             : 
      79             :  
      80             : //____________________________________________________________________________ 
      81             : void AliVZEROQADataMakerSim::InitHits()
      82             : {
      83             :  
      84             :   // create Hits histograms in Hits subdir
      85             :   const Bool_t expert   = kTRUE ; 
      86             :   const Bool_t image    = kTRUE ; 
      87             :   
      88           2 :   TH1I * h0 = new TH1I("hHitMultiplicity", "Hit multiplicity distribution in VZERO;# of Hits;Entries", 300, 0, 299) ; 
      89           1 :   h0->Sumw2() ;
      90           1 :   Add2HitsList(h0, 0, !expert, image) ;  
      91             :   
      92           1 :   TH1I * h1 = new TH1I("hHitCellNumber", "Hit cell distribution in VZERO;# of Hits;Entries", 80, 0, 79) ; 
      93           1 :   h1->Sumw2() ;
      94           1 :   Add2HitsList(h1, 1, !expert, image) ;  
      95             :   //
      96           1 :   ClonePerTrigClass(AliQAv1::kHITS); // this should be the last line    
      97           1 : }
      98             : 
      99             : //____________________________________________________________________________ 
     100             : void AliVZEROQADataMakerSim::InitDigits()
     101             : {
     102             :   // create Digits histograms in Digits subdir
     103             :   const Bool_t expert   = kTRUE ; 
     104             :   const Bool_t image    = kTRUE ; 
     105             :   
     106           2 :   TH1I *fhDigTDC[64]; 
     107           1 :   TH1I *fhDigADC[64]; 
     108             : 
     109             :   // create Digits histograms in Digits subdir
     110           1 :   TH1I * h0 = new TH1I("hDigitMultiplicity", "Digits multiplicity distribution in VZERO;# of Digits;Entries", 100, 0, 99) ; 
     111           1 :   h0->Sumw2() ;
     112           1 :   Add2DigitsList(h0, 0, !expert, image) ;
     113             :   
     114         130 :   for (Int_t i=0; i<64; i++)
     115             :     {
     116         256 :        fhDigTDC[i] = new TH1I(Form("hDigitTDC%d", i),Form("Digit TDC in cell %d; TDC value;Entries",i),300,0.,149.);
     117         256 :        fhDigADC[i]= new TH1I(Form("hDigitADC%d", i),Form("Digit ADC in cell %d;ADC value;Entries",i),1024,0.,1023.);
     118             :        
     119          64 :        Add2DigitsList(fhDigTDC[i],i+1, !expert, image);
     120          64 :        Add2DigitsList(fhDigADC[i],i+1+64, !expert, image);  
     121             :      }  
     122             :   //
     123           1 :   ClonePerTrigClass(AliQAv1::kDIGITS); // this should be the last line
     124           1 : }
     125             : 
     126             : 
     127             : //____________________________________________________________________________
     128             : void AliVZEROQADataMakerSim::MakeHits()
     129             : {
     130             :         //make QA data from Hits
     131             : 
     132           0 :   Int_t nhits = fHitsArray->GetEntriesFast();
     133           0 :   FillHitsData(0,nhits) ;    // fills Hit multiplicity
     134           0 :   for (Int_t ihit=0;ihit<nhits;ihit++) 
     135             :     {
     136           0 :            AliVZEROhit  * VZEROHit   = (AliVZEROhit*) fHitsArray->UncheckedAt(ihit);
     137           0 :            if (!VZEROHit) {
     138           0 :               AliError("The unchecked hit doesn't exist");
     139           0 :               break;
     140             :            }
     141           0 :            FillHitsData(1,VZEROHit->Cell());
     142           0 :         }
     143           0 : }
     144             : 
     145             : 
     146             : //____________________________________________________________________________
     147             : 
     148             : void AliVZEROQADataMakerSim::MakeHits(TTree *hitTree)
     149             : {
     150             :   //fills QA histos for Hits
     151           8 :  if (fHitsArray)
     152           3 :    fHitsArray->Clear() ; 
     153             :   else 
     154           2 :     fHitsArray = new TClonesArray("AliVZEROhit", 1000);
     155             :   
     156           4 :   TBranch * branch = hitTree->GetBranch("VZERO") ;
     157           4 :   if ( ! branch ) {
     158           0 :     AliWarning("VZERO branch in Hit Tree not found") ;
     159           0 :   } else {
     160             : 
     161           4 :    if (branch) {
     162           4 :       branch->SetAddress(&fHitsArray);
     163             :     }else{
     164           0 :       AliError("Branch VZERO hit not found");
     165           0 :       exit(111);
     166             :     } 
     167             :     // Check id histograms already created for this Event Specie
     168           4 :     if ( ! GetHitsData(0) )
     169           0 :       InitHits() ;
     170             :     
     171           4 :     Int_t ntracks    = (Int_t) hitTree->GetEntries();
     172             :     
     173           4 :     if (ntracks<=0) return;
     174             :     // Start loop on tracks in the hits containers
     175         232 :     for (Int_t track=0; track<ntracks;track++) {
     176         112 :       branch->GetEntry(track);
     177         112 :       Int_t nhits = fHitsArray->GetEntriesFast();
     178         112 :       FillHitsData(0,nhits) ;    // fills Hit multiplicity
     179         464 :       for (Int_t ihit=0;ihit<nhits;ihit++) 
     180             :         {
     181          64 :           AliVZEROhit  * VZEROHit   = (AliVZEROhit*) fHitsArray->UncheckedAt(ihit);
     182          64 :           if (!VZEROHit) {
     183           0 :             AliError("The unchecked hit doesn't exist");
     184           0 :             break;
     185             :           }
     186          64 :           FillHitsData(1,VZEROHit->Cell());   
     187          64 :         }
     188             :     }
     189           4 :   }
     190             :   //
     191           4 :   IncEvCountCycleHits();
     192           4 :   IncEvCountTotalHits();
     193             :   //
     194           8 : }
     195             : 
     196             : 
     197             : //____________________________________________________________________________
     198             : void AliVZEROQADataMakerSim::MakeDigits()
     199             : {
     200             :   // makes data from Digits
     201             : 
     202           8 :   FillDigitsData(0,fDigitsArray->GetEntriesFast()) ; 
     203           4 :   TIter next(fDigitsArray) ; 
     204             :     AliVZEROdigit *VZERODigit ; 
     205        1296 :     while ( (VZERODigit = dynamic_cast<AliVZEROdigit *>(next())) ) {
     206         256 :          Int_t   PMNumber  = VZERODigit->PMNumber();         
     207         256 :          FillDigitsData(PMNumber +1, VZERODigit->Time()) ;    // in 100 of picoseconds
     208         256 :          FillDigitsData(PMNumber +1+64, VZERODigit->ADC()) ;
     209             :     }  
     210           4 : }
     211             : 
     212             : 
     213             : //____________________________________________________________________________
     214             : void AliVZEROQADataMakerSim::MakeDigits(TTree *digitTree)
     215             : {
     216             :     // makes data from Digit Tree
     217             :         
     218           8 :   if (fDigitsArray)
     219           3 :     fDigitsArray->Clear() ; 
     220             :   else 
     221           2 :     fDigitsArray = new TClonesArray("AliVZEROdigit", 1000) ; 
     222             : 
     223           4 :     TBranch * branch = digitTree->GetBranch("VZERODigit") ;
     224           4 :     if ( ! branch ) {
     225           0 :          AliWarning("VZERO branch in Digit Tree not found") ; 
     226           0 :     } else {
     227           4 :          branch->SetAddress(&fDigitsArray) ;
     228           4 :          branch->GetEntry(0) ; 
     229           4 :          MakeDigits() ; 
     230             :     }  
     231             :     //
     232           4 :     IncEvCountCycleDigits();
     233           4 :     IncEvCountTotalDigits();
     234             :     //    
     235           4 : }
     236             : 
     237             : 
     238             : //____________________________________________________________________________
     239             : void AliVZEROQADataMakerSim::StartOfDetectorCycle()
     240             : {
     241             :   //Detector specific actions at start of cycle
     242             : 
     243          12 : }

Generated by: LCOV version 1.11