LCOV - code coverage report
Current view: top level - ITS/ITSsim - AliITSsimulation.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 14 46 30.4 %
Date: 2016-06-14 17:26:59 Functions: 3 9 33.3 %

          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             : // This is the base class for ITS detector signal simulations. Data members //
      17             : // include are a pointer to the AliITSDetTypeSim clas in order to access    //
      18             : // segmentation and response objects                                        // 
      19             : // classes. See the detector specific implementations for the propper code. //
      20             : //////////////////////////////////////////////////////////////////////////////
      21             : #include "TClonesArray.h"
      22             : 
      23             : #include "AliITSsimulation.h"
      24             : #include "AliITSpList.h"
      25             : 
      26         116 : ClassImp(AliITSsimulation)
      27             : 
      28             : //______________________________________________________________________
      29           0 : AliITSsimulation::AliITSsimulation(): TObject(),
      30           0 : fDetType(0),
      31           0 : fpList(0),
      32           0 : fModule(0),
      33           0 : fEvent(0),
      34           0 : fDebug(0){
      35             :     // Default constructor
      36             :     // Inputs:
      37             :     //    none.
      38             :     // Outputs:
      39             :     //    none.
      40             :     // Return:
      41             :     //    a default constructed AliITSsimulation class
      42           0 : }
      43             : //______________________________________________________________________
      44           3 : AliITSsimulation::AliITSsimulation(AliITSDetTypeSim *dettyp): TObject(),
      45           3 : fDetType(dettyp),
      46           3 : fpList(0),
      47           3 : fModule(0),
      48           3 : fEvent(0),
      49          12 : fDebug(0){
      50             :     // Default constructor
      51             :     // Inputs:
      52             :     //    AliITSDetTypeSim * : object used to access segmentation and response
      53             :     // Outputs:
      54             :     //    none.
      55             :     // Return:
      56             :     //    a default constructed AliITSsimulation class
      57           3 : }
      58             : //__________________________________________________________________________
      59           6 : AliITSsimulation::~AliITSsimulation(){
      60             :     // destructor
      61             :     // Inputs:
      62             :     //    none.
      63             :     // Outputs:
      64             :     //    none.
      65             :     // Return:
      66             :     //    none.
      67             : 
      68           3 :     if(fpList){
      69           6 :       delete fpList;
      70           3 :       fpList = 0;
      71           3 :     }
      72           3 :    }
      73             : //__________________________________________________________________________
      74           0 : AliITSsimulation::AliITSsimulation(const AliITSsimulation &s) : TObject(s),
      75           0 : fDetType(s.fDetType),
      76           0 : fpList(s.fpList),
      77           0 : fModule(s.fModule),
      78           0 : fEvent(s.fEvent),
      79           0 : fDebug(s.fDebug){
      80             :     //     Copy Constructor
      81             :     // Inputs:
      82             :     //    const AliITSsimulation &s  simulation class to copy from
      83             :     // Outputs:
      84             :     //    none.
      85             :     // Return:
      86             :     //    a standard constructed AliITSsimulation class with values the same
      87             :     //    as that of s.
      88             :  
      89           0 : }
      90             : 
      91             : //_________________________________________________________________________
      92             : AliITSsimulation&  AliITSsimulation::operator=(const AliITSsimulation &s){
      93             :     //    Assignment operator
      94             :     // Inputs:
      95             :     //    const AliITSsimulation &s  simulation class to copy from
      96             :     // Outputs:
      97             :     //    none.
      98             :     // Return:
      99             :     //    a standard constructed AliITSsimulation class with values the same
     100             :     //    as that of s.
     101             : 
     102           0 :     if(&s == this) return *this;
     103           0 :     this->fModule       = s.fModule;
     104           0 :     this->fEvent        = s.fEvent;
     105           0 :     this->fpList        = s.fpList;
     106           0 :     return *this;
     107           0 : }
     108             : //______________________________________________________________________
     109             : Bool_t AliITSsimulation::AddSDigitsToModule(TClonesArray *pItemA,Int_t mask ){
     110             :     // Add Summable digits to module maps.
     111             :     // Inputs:
     112             :     //    TClonesArray *pItemA  Array of AliITSpListItems (SDigits).
     113             :     //    Int_t         mask    Track number off set value (see 
     114             :     //                          AliITSpList::AddItemTo).
     115             :     // Outputs:
     116             :     //    none.
     117             :     // Return:
     118             :     //    kTRUE if there is a signal >0 else kFALSE
     119           0 :     Int_t nItems = pItemA->GetEntries();
     120             :     Bool_t sig = kFALSE;
     121             :  
     122             :     // cout << "Adding "<< nItems <<" SDigits to module " << fModule << endl;
     123           0 :     for( Int_t i=0; i<nItems; i++ ) {
     124           0 :         AliITSpListItem * pItem = (AliITSpListItem *)(pItemA->At( i ));
     125           0 :         if( pItem->GetModule() != fModule ) {
     126           0 :             Error( "AddSDigitsToModule","Error reading, SDigits module %d "
     127             :                    "!= current module %d: exit",
     128           0 :                    pItem->GetModule(), fModule );
     129           0 :             return sig;
     130             :         } // end if
     131           0 :         if(pItem->GetSignal()>0.0 ) sig = kTRUE;
     132           0 :         fpList->AddItemTo( mask, pItem );
     133           0 :     } // end for i
     134           0 :     return sig;
     135           0 : }

Generated by: LCOV version 1.11