1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 ////////////////////////////////////////////////////////////////////////////////
18 // This class contains all code which is used to compute any of the values
19 // which can be of interest within a resonance analysis. Besides the obvious
20 // invariant mass, it allows to compute other utility values on all possible
21 // targets, in order to allow a wide spectrum of binning and checks.
22 // When needed, this object can also define a binning in the variable which
23 // it is required to compute, which is used for initializing axes of output
24 // histograms (see AliRsnFunction).
25 // The value computation requires this object to be passed the object whose
26 // informations will be used. This object can be of any allowed input type
27 // (track, pair, event), then this class must inherit from AliRsnTarget.
28 // Then, when value computation is attempted, a check on target type is done
29 // and computation is successful only if expected target matches that of the
31 // In some cases, the value computation can require a support external object,
32 // which must then be passed to this class. It can be of any type inheriting
35 // authors: A. Pulvirenti (alberto.pulvirenti@ct.infn.it)
36 // M. Vala (martin.vala@cern.ch)
38 ////////////////////////////////////////////////////////////////////////////////
40 #include "Riostream.h"
48 #include "AliPIDResponse.h"
50 #include "AliRsnDaughter.h"
51 #include "AliRsnEvent.h"
53 #include "AliRsnMiniMonitor.h"
55 ClassImp(AliRsnMiniMonitor)
57 //__________________________________________________________________________________________________
58 AliRsnMiniMonitor::AliRsnMiniMonitor() :
70 //__________________________________________________________________________________________________
71 AliRsnMiniMonitor::AliRsnMiniMonitor(const char *name, EType type, Int_t cutID) :
79 // Default constructor
83 //__________________________________________________________________________________________________
84 AliRsnMiniMonitor::AliRsnMiniMonitor(const AliRsnMiniMonitor& copy) :
88 fListID(copy.fListID),
96 //__________________________________________________________________________________________________
97 AliRsnMiniMonitor& AliRsnMiniMonitor::operator=(const AliRsnMiniMonitor& copy)
100 // Assignment operator
103 TNamed::operator=(copy);
105 fCutID = copy.fCutID;
106 fListID = copy.fListID;
112 //__________________________________________________________________________________________________
113 Bool_t AliRsnMiniMonitor::Init(const char *name, TList *list)
116 // Initialize this output histogram and put into the passed list
127 AliError("No list!");
132 TH1 *histogram = 0x0;
136 sname += "_TPCsignal";
137 histogram = new TH2F(sname.Data(), "", 500, 0.0, 5.0, 1000, 0.0, 1000.0);
140 sname += "_TOFsignal";
141 histogram = new TH2F(sname.Data(), "", 500, 0.0, 5.0, 1000, 0.0, 200000.0);
144 AliError("Wrong enum type");
149 if (histogram && fList) {
151 fList->Add(histogram);
152 fListID = fList->IndexOf(histogram);
153 AliInfo(Form("Histogram '%s' added to list in slot #%d", histogram->GetName(), fListID));
160 //_____________________________________________________________________________
161 Bool_t AliRsnMiniMonitor::Fill(AliRsnDaughter *track, AliRsnEvent *event)
164 // Fill the histogram
167 // retrieve object from list
169 AliError("List pointer is NULL");
172 TObject *obj = fList->At(fListID);
174 AliError("List object is NULL");
178 Double_t valueX, valueY;
179 AliVTrack *vtrack = track->Ref2Vtrack();
181 AliPIDResponse *pid = event->GetPIDResponse();
186 AliWarning("Required vtrack for this value");
189 valueX = vtrack->GetTPCmomentum();
190 valueY = vtrack->GetTPCsignal();
191 ((TH2F*)obj)->Fill(valueX, valueY);
195 AliWarning("Required vtrack for this value");
198 valueX = vtrack->P();
199 //valueY = vtrack->GetTOFsignal();
201 if (pid) valueY = pid->NumberOfSigmasTOF(vtrack, AliPID::kKaon);
202 ((TH2F*)obj)->Fill(valueX, valueY);
205 AliError("Invalid value type");