LCOV - code coverage report
Current view: top level - MUON/MUONsim - AliMUONQADataMakerSim.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 86 1.2 %
Date: 2016-06-14 17:26:59 Functions: 1 17 5.9 %

          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             : // $Id$
      17             : 
      18             : #include "AliMUONQADataMakerSim.h"
      19             : #include "AliMUONHit.h"  
      20             : #include "AliMUONDigit.h"  
      21             : #include "AliMUONVHitStore.h"
      22             : #include "AliMUONVDigitStore.h"
      23             : 
      24             : // --- AliRoot header files ---
      25             : #include "AliLog.h"
      26             : #include "AliQAChecker.h"
      27             : 
      28             : // --- ROOT system ---
      29             : #include <TClonesArray.h>
      30             : #include <TFile.h> 
      31             : #include <TH1F.h> 
      32             : #include <TH1I.h> 
      33             : #include <TH2F.h> 
      34             : #include <TTree.h>
      35             : 
      36             : //-----------------------------------------------------------------------------
      37             : /// \class AliMUONQADataMakerSim
      38             : ///
      39             : /// MUON base class for quality assurance data (histo) maker
      40             : ///
      41             : /// \author C. Finck
      42             : 
      43             : /// \cond CLASSIMP
      44          16 : ClassImp(AliMUONQADataMakerSim)
      45             : /// \endcond
      46             :            
      47             : //____________________________________________________________________________ 
      48             : AliMUONQADataMakerSim::AliMUONQADataMakerSim() : 
      49           0 :     AliQADataMakerSim(AliQAv1::GetDetName(AliQAv1::kMUON), "MUON Quality Assurance Data Maker"),
      50           0 :     fHitStore(0x0),
      51           0 :     fDigitStore(0x0)   
      52           0 : {
      53             :   /// Default constructor
      54             : 
      55           0 :       AliDebug(AliQAv1::GetQADebugLevel(),"");
      56           0 : }
      57             : 
      58             : //____________________________________________________________________________ 
      59             : AliMUONQADataMakerSim::AliMUONQADataMakerSim(const AliMUONQADataMakerSim& qadm) :
      60           0 :     AliQADataMakerSim(),
      61           0 :   fHitStore(0x0),
      62           0 :   fDigitStore(0x0)
      63           0 : {
      64             :   /// Copy constructor
      65             : 
      66           0 :     AliDebug(AliQAv1::GetQADebugLevel(),"");
      67             : 
      68           0 :     if ( qadm.fHitStore ) 
      69             :     {
      70           0 :       fHitStore = static_cast<AliMUONVHitStore*>(qadm.fHitStore->Clone());
      71           0 :     }
      72           0 :     if ( qadm.fDigitStore ) 
      73             :     {
      74           0 :       fDigitStore = static_cast<AliMUONVDigitStore*>(qadm.fDigitStore->Clone());
      75           0 :     }
      76           0 :     SetName((const char*)qadm.GetName()) ; 
      77           0 :     SetTitle((const char*)qadm.GetTitle()); 
      78           0 : }
      79             : 
      80             : //__________________________________________________________________
      81             : AliMUONQADataMakerSim& AliMUONQADataMakerSim::operator = (const AliMUONQADataMakerSim& qadm )
      82             : {
      83             :   /// Assignment operator
      84             : 
      85           0 :   AliDebug(AliQAv1::GetQADebugLevel(),"");
      86             : 
      87           0 :     this->~AliMUONQADataMakerSim();
      88           0 :     new(this) AliMUONQADataMakerSim(qadm);
      89           0 :     return *this;
      90           0 : }
      91             : 
      92             : //__________________________________________________________________
      93             : AliMUONQADataMakerSim::~AliMUONQADataMakerSim()
      94           0 : {
      95             :   /// Destructor
      96             : 
      97           0 :   AliDebug(AliQAv1::GetQADebugLevel(),"");
      98             : 
      99           0 :   delete fHitStore;
     100           0 :   delete fDigitStore;
     101           0 : }
     102             : 
     103             : //__________________________________________________________________
     104             : void AliMUONQADataMakerSim::InitHits() 
     105             : {
     106             :   /// Initialized hit spectra
     107             :   const Bool_t expert   = kTRUE ; 
     108             :   const Bool_t image    = kTRUE ; 
     109             :   
     110           0 :   TH1F* h0 = new TH1F("hHitDetElem", "DetElemId distribution in Hits;Detection element Id;Counts", 1400, 100., 1500.); 
     111           0 :   Add2HitsList(h0, 0, !expert, image);
     112             : 
     113           0 :   TH1F* h1 = new TH1F("hHitPtot", "P distribution in Hits;P [erg];Counts ", 300, 0., 300.); 
     114           0 :   Add2HitsList(h1, 1, !expert, image);
     115             :   //
     116           0 :   ClonePerTrigClass(AliQAv1::kHITS); // this should be the last line
     117           0 : } 
     118             : 
     119             : //__________________________________________________________________
     120             : void AliMUONQADataMakerSim::InitSDigits() 
     121             : {
     122             :   /// Initialized SDigits spectra
     123             :   const Bool_t expert   = kTRUE ; 
     124             :   const Bool_t image    = kTRUE ; 
     125             :   
     126           0 :   TH1I* h0 = new TH1I("hSDigitsDetElem", "Detection element distribution in SDigits;Detection element Id;Counts",  1400, 100, 1500); 
     127           0 :   Add2SDigitsList(h0, 0, !expert, image);
     128             : 
     129           0 :   TH1F* h1 = new TH1F("hSDigitsCharge", "Charge distribution in SDigits;Charge [??];Counts", 4096, 0, 4095); 
     130           0 :   Add2SDigitsList(h1, 1, !expert, image);
     131             :   //
     132           0 :   ClonePerTrigClass(AliQAv1::kSDIGITS); // this should be the last line
     133           0 : }  
     134             : 
     135             : //__________________________________________________________________
     136             : void AliMUONQADataMakerSim::InitDigits() 
     137             : {
     138             :   /// Initialized Digits spectra 
     139             :   const Bool_t expert   = kTRUE ; 
     140             :   const Bool_t image    = kTRUE ; 
     141             :   
     142           0 :   TH1I* h0 = new TH1I("hDigitsDetElem", "Detection element distribution in Digits;Detection element Id;Counts",  1400, 100, 1500); 
     143           0 :   Add2DigitsList(h0, 0, !expert, image);
     144             : 
     145           0 :   TH1I* h1 = new TH1I("hDigitsADC", "ADC distribution in Digits;ACD value;Counts", 4096, 0, 4095); 
     146           0 :   Add2DigitsList(h1, 1, !expert, image);  
     147             :   //
     148           0 :   ClonePerTrigClass(AliQAv1::kDIGITS); // this should be the last line
     149           0 : } 
     150             : 
     151             : //__________________________________________________________________
     152             : void AliMUONQADataMakerSim::MakeHits(TTree* hitsTree)        
     153             : {
     154             :   /// makes data from Hits
     155             : 
     156           0 :   if (!fHitStore)
     157           0 :     fHitStore = AliMUONVHitStore::Create(*hitsTree);
     158           0 :   fHitStore->Connect(*hitsTree, false);
     159           0 :   hitsTree->GetEvent(0);
     160             :     
     161           0 :   TIter next(fHitStore->CreateIterator());
     162             : 
     163             :   AliMUONHit* hit = 0x0;
     164             : 
     165           0 :   while ( ( hit = static_cast<AliMUONHit*>(next()) ) )
     166             :   {
     167           0 :     FillHitsData(0,hit->DetElemId());
     168           0 :     FillHitsData(1,hit->Momentum());
     169             :   }
     170             :   //
     171           0 :   IncEvCountCycleHits();
     172           0 :   IncEvCountTotalHits();
     173             :   //
     174           0 : }
     175             : 
     176             : //__________________________________________________________________
     177             : void AliMUONQADataMakerSim::MakeSDigits(TTree* sdigitsTree)        
     178             : {
     179             :   /// makes data from SDigits
     180             : 
     181           0 :   if (!fDigitStore)
     182           0 :     fDigitStore = AliMUONVDigitStore::Create(*sdigitsTree);
     183           0 :   fDigitStore->Connect(*sdigitsTree, false);
     184           0 :   sdigitsTree->GetEvent(0);
     185             :     
     186           0 :   TIter next(fDigitStore->CreateIterator());
     187             : 
     188             :   AliMUONVDigit* dig = 0x0;
     189             : 
     190           0 :   while ( ( dig = static_cast<AliMUONVDigit*>(next()) ) )
     191             :   {
     192           0 :     FillSDigitsData(0,dig->DetElemId());
     193           0 :     FillSDigitsData(1,dig->Charge());
     194             :   }
     195             :   //
     196           0 :   IncEvCountCycleSDigits();
     197           0 :   IncEvCountTotalSDigits();
     198             :   //
     199           0 : } 
     200             : 
     201             : //__________________________________________________________________
     202             : void AliMUONQADataMakerSim::MakeDigits(TTree* digitsTree)         
     203             : {
     204             :    /// makes data from Digits
     205             :   
     206           0 :   if (!fDigitStore)
     207           0 :     fDigitStore = AliMUONVDigitStore::Create(*digitsTree);
     208           0 :   fDigitStore->Connect(*digitsTree, false);
     209           0 :   digitsTree->GetEvent(0);
     210             :     
     211           0 :   TIter next(fDigitStore->CreateIterator());
     212             : 
     213             :   AliMUONVDigit* dig = 0x0;
     214             : 
     215           0 :   while ( ( dig = static_cast<AliMUONVDigit*>(next()) ) )
     216             :   {
     217           0 :     FillDigitsData(0,dig->DetElemId());
     218           0 :     FillDigitsData(1,dig->ADC());
     219             :   }
     220             :   //
     221           0 :   IncEvCountCycleDigits();
     222           0 :   IncEvCountTotalDigits();
     223             :   //
     224           0 : }
     225             :       
     226             : //____________________________________________________________________________ 
     227             : void AliMUONQADataMakerSim::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray** list)
     228             : {
     229             :     ///Detector specific actions at end of cycle
     230             :     // do the QA checking
     231           0 :   ResetEventTrigClasses();
     232           0 :   AliQAChecker::Instance()->Run(AliQAv1::kMUON, task, list) ;  
     233           0 : }
     234             : 
     235             : 
     236             : //____________________________________________________________________________ 
     237             : void AliMUONQADataMakerSim::StartOfDetectorCycle()
     238             : {
     239             :     /// Detector specific actions at start of cycle
     240             :   
     241           0 : }

Generated by: LCOV version 1.11