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