]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSsimulation.cxx
Added macro for visualization of the TOF ROOT geometry
[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 }
29 //__________________________________________________________________________
30 AliITSsimulation::~AliITSsimulation(){
31     // destructor
32     fSegmentation = 0; // local copies of pointer, do not delete
33     fResponse     = 0; // local copies of pointer, do not delete
34     delete fpList;
35 }
36 //__________________________________________________________________________
37 AliITSsimulation::AliITSsimulation(const AliITSsimulation &source){
38     //     Copy Constructor 
39  
40     if(&source == this) return;
41     this->fResponse     = source.fResponse;
42     this->fSegmentation = source.fSegmentation;
43     this->fModule       = source.fModule;
44     this->fEvent        = source.fEvent;
45     this->fpList        = source.fpList;
46     return;
47 }
48
49 //_________________________________________________________________________
50 AliITSsimulation&  AliITSsimulation::operator=(const AliITSsimulation &source){
51     //    Assignment operator
52
53     if(&source == this) return *this;
54     this->fResponse     = source.fResponse; 
55     this->fSegmentation = source.fSegmentation;
56     this->fModule       = source.fModule;
57     this->fEvent        = source.fEvent;
58     this->fpList        = source.fpList;
59     return *this;
60 }
61 //______________________________________________________________________
62 Bool_t AliITSsimulation::AddSDigitsToModule(TClonesArray *pItemA,Int_t mask ){
63     // Add Summable digits to module maps.
64     Int_t nItems = pItemA->GetEntries();
65     Bool_t sig = kFALSE;
66  
67     // cout << "Adding "<< nItems <<" SDigits to module " << fModule << endl;
68     for( Int_t i=0; i<nItems; i++ ) {
69         AliITSpListItem * pItem = (AliITSpListItem *)(pItemA->At( i ));
70         if( pItem->GetModule() != fModule ) {
71             Error( "AddSDigitsToModule","Error reading, SDigits module %d "
72                    "!= current module %d: exit",
73                    pItem->GetModule(), fModule );
74             return sig;
75         } // end if
76         if(pItem->GetSignal()>0.0 ) sig = kTRUE;
77         fpList->AddItemTo( mask, pItem );
78     } // end for i
79     return sig;
80 }