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: Kyrre Skjerdal *
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 AliHLTUpcTriggerComponent.cxx
19 /// @author Kyrre Skjerdal
21 /// @brief HLT trigger component for Ultra-Peripheral Collisions
23 // see header file for class documentation
25 // refer to README to build package
27 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
30 #include "AliHLTUpcTriggerComponent.h"
31 #include "AliESDEvent.h"
32 #include "AliHLTTriggerDecision.h"
33 #include "AliHLTDomainEntry.h"
34 ClassImp(AliHLTUpcTriggerComponent)
36 const char* AliHLTUpcTriggerComponent::GetTriggerName() const
38 //See header file for documentation
42 AliHLTComponent* AliHLTUpcTriggerComponent::Spawn()
44 //See header file for documentation
45 return new AliHLTUpcTriggerComponent;
48 int AliHLTUpcTriggerComponent::DoTrigger()
50 //See header file for documentation
51 HLTInfo("Entering DoTrigger()");
52 const TObject* obj = GetFirstInputObject(kAliHLTAllDataTypes, "AliESDEvent");
53 AliESDEvent* esd = dynamic_cast<AliESDEvent*>(const_cast<TObject*>(obj));
57 //We skip events with no primary vertex reconstructed
58 if(!(PrimaryVertexReconstructed(esd))){
59 HLTWarning("No primary vertex reconstructed");
60 SetDescription("No reconstructed primary vertex. Not a candidate for an Ultra-peripheral Collison");
69 for (Int_t i = 0; i < esd->GetNumberOfTracks(); i++){
70 cout << "Track number: " << esd->GetNumberOfTracks() << endl;
71 AliESDtrack* track = esd->GetTrack(i);
73 Int_t nItsClusters = track->GetNcls(0);
74 Int_t nTpcClusters = track->GetNcls(1);
78 track->GetImpactParametersTPC(bxy, bz);
80 //Check if the track is comming from the primary vertex
81 Bool_t isPrimary = kFALSE;
82 if(fabs(bxy) < 1.5 && fabs(bz) < 1.5){
86 Int_t charge = track->Charge();
88 if(nItsClusters > 3 && nTpcClusters > 50 && isPrimary){
92 } else if(nGoodRec == 2){
99 //Demand two good tracks with opposite charge
101 if(charge1 == -charge2){
102 SetDescription("Event is a candidate for an Ultra-peripheral Collision.");
103 // Enable the central detectors for readout.
104 GetReadoutList().Enable(
106 AliHLTReadoutList::kITSSPD |
107 AliHLTReadoutList::kITSSDD |
108 AliHLTReadoutList::kITSSSD |
109 AliHLTReadoutList::kTPC |
110 AliHLTReadoutList::kTRD |
111 AliHLTReadoutList::kTRD |
112 AliHLTReadoutList::kTOF |
113 AliHLTReadoutList::kHMPID |
114 AliHLTReadoutList::kPHOS
116 // Add the available HLT information for readout too.
117 GetTriggerDomain().Add(kAliHLTAnyDataTypeID, "ISPD");
118 GetTriggerDomain().Add(kAliHLTAnyDataTypeID, "ISDD");
119 GetTriggerDomain().Add(kAliHLTAnyDataTypeID, "ISSD");
120 GetTriggerDomain().Add(kAliHLTAnyDataTypeID, "ITPC");
121 GetTriggerDomain().Add(kAliHLTAnyDataTypeID, "ITRD");
122 GetTriggerDomain().Add(kAliHLTAnyDataTypeID, "IPHOS");
129 HLTFatal("No ESD found");
130 SetDescription("Not a candidate for an Ultra-peripheral Collision.");
134 SetDescription("Not a candidate for an Ultra-peripheral Collision.");
139 void AliHLTUpcTriggerComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier)
141 //See header file for documentation
143 constBase = sizeof(AliHLTTriggerDecision) + sizeof(AliHLTDomainEntry)*14;
148 Bool_t AliHLTUpcTriggerComponent::PrimaryVertexReconstructed(const AliESDEvent *event) const
150 //See header file for documentation
152 return (event->GetPrimaryVertex()->GetNContributors() > 0);