2 //**************************************************************************
3 //* This file is property of and copyright by the ALICE HLT Project *
4 //* ALICE Experiment at CERN, All rights reserved. *
6 //* Primary Authors: Kenneth Aamodt <kenneth.aamodt@cern.ch> *
7 //* for The ALICE HLT Project. *
9 //* Permission to use, copy, modify and distribute this software and its *
10 //* documentation strictly for non-commercial purposes is hereby granted *
11 //* without fee, provided that the above copyright notice appears in all *
12 //* copies and that both the copyright notice and this permission notice *
13 //* appear in the supporting documentation. The authors make no claims *
14 //* about the suitability of this software for any purpose. It is *
15 //* provided "as is" without express or implied warranty. *
16 //**************************************************************************
18 /// @file AliHLTTriggerGammaConversion.cxx
19 /// @author Kenneth Aamodt
21 /// @brief HLT trigger component for gamma conversions.
24 // see header file for class documentation
26 // refer to README to build package
28 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
30 #include "AliHLTTriggerGammaConversion.h"
31 #include "AliESDEvent.h"
33 #include "AliHLTTriggerDecision.h"
34 #include "AliHLTDomainEntry.h"
35 #include "AliHLTGlobalBarrelTrack.h"
36 #include "AliKFParticle.h"
37 #include "AliKFVertex.h"
38 #include "TObjArray.h"
39 #include "TObjString.h"
41 /** ROOT macro for the implementation of ROOT specific class methods */
42 ClassImp(AliHLTTriggerGammaConversion)
44 AliHLTTriggerGammaConversion::AliHLTTriggerGammaConversion()
51 , fNReconstructedGammas(0)
53 // see header file for class documentation
55 // refer to README to build package
57 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
60 const char* AliHLTTriggerGammaConversion::fgkOCDBEntry="HLT/ConfigHLT/GammaConversionTrigger";
62 AliHLTTriggerGammaConversion::~AliHLTTriggerGammaConversion()
64 // see header file for class documentation
67 const char* AliHLTTriggerGammaConversion::GetTriggerName() const
69 // see header file for class documentation
70 return "GammaConversionTrigger";
73 AliHLTComponent* AliHLTTriggerGammaConversion::Spawn()
75 // see header file for class documentation
76 return new AliHLTTriggerGammaConversion;
79 int AliHLTTriggerGammaConversion::DoTrigger()
81 // see header file for class documentation
83 fNReconstructedGammas=0;
85 if ( GetFirstInputBlock( kAliHLTDataTypeSOR ) || GetFirstInputBlock( kAliHLTDataTypeEOR ) )
88 for ( const TObject *iter = GetFirstInputObject(kAliHLTDataTypeESDObject); iter != NULL; iter = GetNextInputObject() ) {
90 AliESDEvent *event = dynamic_cast<AliESDEvent*>(const_cast<TObject*>( iter ) );
91 event->GetStdContent();
92 Int_t nV0 = event->GetNumberOfV0s();
96 AliKFParticle::SetField( event->GetMagneticField() );
98 for (Int_t iv=0; iv<nV0; iv++) {
100 AliESDtrack *t1=event->GetTrack( event->GetV0(iv)->GetNindex());
101 AliESDtrack *t2=event->GetTrack( event->GetV0(iv)->GetPindex());
103 AliKFParticle kf1( *t1->GetInnerParam(), 11 );
104 AliKFParticle kf2( *t2->GetInnerParam(), 11 );
106 AliKFVertex primVtx( *event->GetPrimaryVertexTracks() );
108 AliKFParticle v0( kf1, kf2 );
110 v0.SetProductionVertex( primVtx );
112 if(kf1.GetDistanceFromParticle(kf2)>fMaxDca){
117 v0.GetMass(mass,error);
118 if( TMath::Abs(mass)>fMaxInvMass ){
122 AliKFParticle gamma = v0;
123 gamma.SetMassConstraint(0);
125 double r= sqrt(gamma.GetX()*gamma.GetX()+gamma.GetY()*gamma.GetY());
129 if(gamma.GetPt()<fPtMin){
134 if(gamma.GetPt()>fPtMax){
139 fNReconstructedGammas++;
143 TString maxInvMass, ptcut, maxDca, maxR;
144 maxInvMass.Form(" mass < %.03f GeV ,",fMaxInvMass);
146 ptcut.Form(" %.02f GeV/c <= pt <= %.02f GeV/c ,", fPtMin, fPtMax);
148 ptcut.Form(" pt >= %.02f GeV/c ,", fPtMin);
150 maxDca.Form(" dca <= %.04fcm ,",fMaxDca);
151 maxR.Form(" r <= %.02cm", fMaxR);
153 if(fNReconstructedGammas>0){
154 description.Form("Event contains %d gamma conversions,", fNReconstructedGammas);
155 description += ptcut;
156 description += maxDca;
159 SetDescription(description.Data());
161 GetReadoutList().Enable(
162 AliHLTReadoutList::kITSSPD |
163 AliHLTReadoutList::kITSSDD |
164 AliHLTReadoutList::kITSSSD |
165 AliHLTReadoutList::kTPC |
166 AliHLTReadoutList::kTRD |
167 AliHLTReadoutList::kTOF |
168 AliHLTReadoutList::kHMPID |
169 AliHLTReadoutList::kPHOS
171 // Add the available HLT information for readout too.
176 description.Form("No Gamma Conversions reconstructed that satisfy:");
177 description += ptcut;
178 description += maxDca;
181 SetDescription(description.Data());
186 int AliHLTTriggerGammaConversion::DoInit(int argc, const char** argv)
188 // see header file for class documentation
190 // first configure the default
192 iResult=ConfigureFromCDBTObjString(fgkOCDBEntry);
194 // configure from the command line parameters if specified
195 if (iResult>=0 && argc>0)
196 iResult=ConfigureFromArgumentString(argc, argv);
200 int AliHLTTriggerGammaConversion::DoDeinit()
202 // see header file for class documentation
206 int AliHLTTriggerGammaConversion::Reconfigure(const char* cdbEntry, const char* /*chainId*/)
208 // see header file for class documentation
210 // configure from the specified antry or the default one
211 const char* entry=cdbEntry;
212 if (!entry || entry[0]==0) {
216 return ConfigureFromCDBTObjString(entry);
219 int AliHLTTriggerGammaConversion::ScanConfigurationArgument(int argc, const char** argv)
221 // see header file for class documentation
222 if (argc<=0) return 0;
224 TString argument=argv[i];
227 if (argument.CompareTo("-max-invmass")==0) {
228 if (++i>=argc) return -EPROTO;
230 fMaxInvMass=argument.Atof();
235 if (argument.CompareTo("-max-pt")==0) {
236 if (++i>=argc) return -EPROTO;
238 fPtMax=argument.Atof();
243 if (argument.CompareTo("-min-pt")==0) {
244 if (++i>=argc) return -EPROTO;
246 fPtMin=argument.Atof();
252 if (argument.CompareTo("-max-dca")==0) {
253 if (++i>=argc) return -EPROTO;
255 fMaxDca=argument.Atof();
260 // maximum radius of v0 in xy-plane
261 if (argument.CompareTo("-max-r")==0) {
262 if (++i>=argc) return -EPROTO;
264 fMaxR=argument.Atof();