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 : //
17 : // xx
18 : // xx
19 : // xx
20 : // xx
21 : // xx
22 : //
23 : // Xianguo Lu
24 : // lu@physi.uni-heidelberg.de
25 : // Xianguo.Lu@cern.ch
26 : //
27 : //
28 : #include "THnBase.h"
29 : #include "THn.h"
30 : #include "TCollection.h"
31 : #include "AliLog.h"
32 :
33 : #include "AliTRDdEdxBaseUtils.h"
34 : #include "AliTRDdEdxCalibHistArray.h"
35 :
36 48 : ClassImp(AliTRDdEdxCalibHistArray);
37 :
38 : AliTRDdEdxCalibHistArray::AliTRDdEdxCalibHistArray(const Bool_t kNoInv):
39 0 : TObjArray(kNoInv ? 4: 8)
40 0 : {
41 : //
42 : //constructor
43 : //
44 0 : SetName(GetArrayName());
45 0 : SetOwner(kTRUE);
46 :
47 0 : const Int_t nbin[2]={AliTRDdEdxBaseUtils::NTRDtimebin(), 200};
48 : const Double_t xmin[2]={0, 0.01};
49 0 : const Double_t xmax[2]={static_cast<Double_t>(nbin[0]), 10};
50 0 : const TString aname[2]={"globalTimeBin", "trdqovertpc"};
51 0 : const TString atitle[2]={"det * AliTRDseedV1::kNtb + itb", "TRD-Cluster-Q / TPC-Signal"};
52 :
53 0 : for(Int_t iter=0; iter<GetSize(); iter++){
54 0 : THnBase *hi = new THnF(GetNameAt(iter), "", 2, nbin, xmin, xmax);
55 0 : for(Int_t iaxis=0; iaxis<2; iaxis++){
56 0 : TAxis *xi = hi->GetAxis(iaxis);
57 0 : xi->SetName(aname[iaxis]);
58 0 : xi->SetTitle(atitle[iaxis]);
59 : //only log for y-axis
60 0 : if(iaxis==1){
61 0 : AliTRDdEdxBaseUtils::BinLogX(xi);
62 : }
63 : }
64 0 : AddAt(hi, iter);
65 : }
66 0 : }
67 :
68 : AliTRDdEdxCalibHistArray::AliTRDdEdxCalibHistArray(const AliTRDdEdxCalibHistArray &obj):
69 0 : TObjArray(obj)
70 0 : {
71 : //
72 : //copy constructor
73 : //
74 0 : }
75 :
76 : AliTRDdEdxCalibHistArray & AliTRDdEdxCalibHistArray::operator=(const AliTRDdEdxCalibHistArray &obj)
77 : {
78 : //
79 : //assignment operator
80 : //
81 :
82 0 : if(&obj == this) return *this;
83 :
84 0 : TObjArray::operator=(obj);
85 :
86 0 : return *this;
87 0 : }
88 :
89 : Long64_t AliTRDdEdxCalibHistArray::Merge(const TCollection* list)
90 : {
91 : //
92 : // Merge list of objects (needed by PROOF)
93 : //
94 :
95 0 : if(!list)
96 0 : return 0;
97 :
98 0 : if(list->IsEmpty())
99 0 : return 1;
100 :
101 0 : TIterator* iter = list->MakeIterator();
102 : TObject* obj = 0;
103 :
104 : Int_t count=0;
105 0 : while((obj = iter->Next()) != 0)
106 : {
107 0 : AliTRDdEdxCalibHistArray * entry = dynamic_cast<AliTRDdEdxCalibHistArray*>(obj);
108 0 : if (entry == 0) continue;
109 :
110 0 : if(GetSize()!= entry->GetSize()){
111 0 : AliFatal(Form("GetSize()!= entry->GetSize() %d %d\n", GetSize(), entry->GetSize()));
112 0 : }
113 :
114 0 : for(Int_t ii=0; ii<GetSize(); ii++){
115 0 : THnBase *h0 = (THnBase*) At(ii);
116 0 : THnBase *h1 = (THnBase*) entry->At(ii);
117 0 : h0->Add(h1);
118 : }
119 :
120 0 : count++;
121 0 : }
122 :
123 0 : return count;
124 :
125 0 : }
|