]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSsimulation.cxx
Set Getters to be const and general fixed up and added some extra setters
[u/mrichter/AliRoot.git] / ITS / AliITSsimulation.cxx
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 #include "TClonesArray.h"
17
18 #include "AliITSsimulation.h"
19 #include "AliITSpList.h"
20
21 ClassImp(AliITSsimulation)
22
23 AliITSsimulation::AliITSsimulation(){
24     // constructor
25     fSegmentation = 0;
26     fResponse     = 0;
27     fpList        = 0;
28     fModule       = 0;
29     fEvent        = 0;
30 }
31 //__________________________________________________________________________
32 AliITSsimulation::~AliITSsimulation(){
33     // destructor
34     fSegmentation = 0; // local copies of pointer, do not delete
35     fResponse     = 0; // local copies of pointer, do not delete
36     delete fpList;
37 }
38 //__________________________________________________________________________
39 AliITSsimulation::AliITSsimulation(const AliITSsimulation &s) : TObject(s){
40     //     Copy Constructor 
41  
42     *this = s;
43     return;
44 }
45
46 //_________________________________________________________________________
47 AliITSsimulation&  AliITSsimulation::operator=(const AliITSsimulation &s){
48     //    Assignment operator
49
50     if(&s == this) return *this;
51     this->fResponse     = s.fResponse; 
52     this->fSegmentation = s.fSegmentation;
53     this->fModule       = s.fModule;
54     this->fEvent        = s.fEvent;
55     this->fpList        = s.fpList;
56     return *this;
57 }
58 //______________________________________________________________________
59 Bool_t AliITSsimulation::AddSDigitsToModule(TClonesArray *pItemA,Int_t mask ){
60     // Add Summable digits to module maps.
61     Int_t nItems = pItemA->GetEntries();
62     Bool_t sig = kFALSE;
63  
64     // cout << "Adding "<< nItems <<" SDigits to module " << fModule << endl;
65     for( Int_t i=0; i<nItems; i++ ) {
66         AliITSpListItem * pItem = (AliITSpListItem *)(pItemA->At( i ));
67         if( pItem->GetModule() != fModule ) {
68             Error( "AddSDigitsToModule","Error reading, SDigits module %d "
69                    "!= current module %d: exit",
70                    pItem->GetModule(), fModule );
71             return sig;
72         } // end if
73         if(pItem->GetSignal()>0.0 ) sig = kTRUE;
74         fpList->AddItemTo( mask, pItem );
75     } // end for i
76     return sig;
77 }