#include "AliHLTTriggerDecision.h"
#include "AliHLTDomainEntry.h"
#include "AliHLTGlobalBarrelTrack.h"
+#include "TObjArray.h"
+#include "TObjString.h"
/** ROOT macro for the implementation of ROOT specific class methods */
ClassImp(AliHLTTriggerBarrelMultiplicity)
, fPtMin(0.0)
, fPtMax(0.0)
, fMinTracks(1)
+ , fDCAReference()
+ , fMinLDca(-1.)
+ , fMaxLDca(-1.)
+ , fMinTDca(-1.)
+ , fMaxTDca(-1.)
+ , fSolenoidBz(0.0)
{
// see header file for class documentation
// or
// refer to README to build package
// or
// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
+ for (int i=0; i<fgkDCAReferenceSize; i++) fDCAReference[i]=0.0;
}
const char* AliHLTTriggerBarrelMultiplicity::fgkOCDBEntry="HLT/ConfigHLT/BarrelMultiplicityTrigger";
const TObject* obj = GetFirstInputObject(kAliHLTAllDataTypes, "AliESDEvent");
AliESDEvent* esd = dynamic_cast<AliESDEvent*>(const_cast<TObject*>(obj));
TString description;
- TString ptcut;
+ TString ptcut,tdca,ldca,dcaref,op1st,op2nd;
if (esd != NULL) {
numberOfTracks=0;
esd->GetStdContent();
for (Int_t i = 0; i < esd->GetNumberOfTracks(); i++) {
- if (CheckCondition(esd->GetTrack(i))) numberOfTracks++;
+ if (CheckCondition(esd->GetTrack(i), esd->GetMagneticField())) numberOfTracks++;
}
}
if ((iResult=AliHLTGlobalBarrelTrack::ConvertTrackDataArray(reinterpret_cast<const AliHLTTracksData*>(pBlock->fPtr), pBlock->fSize, tracks))>0) {
for (vector<AliHLTGlobalBarrelTrack>::iterator element=tracks.begin();
element!=tracks.end(); element++) {
- if (CheckCondition(&(*element))) numberOfTracks++;
+ if (CheckCondition(&(*element), fSolenoidBz)) numberOfTracks++;
}
} else if (iResult<0) {
HLTError("can not extract tracks from data block of type %s (specification %08x) of size %d: error %d",
} else {
ptcut.Form(" pt >= %.02f GeV/c", fPtMin);
}
+
+ if (fMinTDca>=0.0) {
+ if (fMaxTDca>=0.0) {
+ tdca.Form(", %.02f<=transverse_dca<=%.02f", fMinTDca, fMaxTDca);
+ } else {
+ tdca.Form(" transverse_dca >= %.02f", fMinTDca);
+ }
+ } else if (fMaxTDca>=0.0) {
+ tdca.Form(" transverse_dca<=%.02f", fMaxTDca);
+ }
+ if (!tdca.IsNull()) {
+ if (op1st.IsNull()) op1st=" && ";
+ else op2nd=" && ";
+ }
+
+ if (fMinLDca>=0.0) {
+ if (fMaxLDca>=0.0) {
+ ldca.Form(" %.02f<=longitudinal_dca<=%.02f", fMinLDca, fMaxLDca);
+ } else {
+ ldca.Form(" longitudinal_dca >= %.02f", fMinLDca);
+ }
+ } else if (fMaxLDca>=0.0) {
+ ldca.Form(" longitudinal_dca<=%.02f", fMaxLDca);
+ }
+ if (!ldca.IsNull()) {
+ if (op1st.IsNull()) op1st=" && ";
+ else op2nd=" && ";
+ }
+
+ if (fMinTDca>=0.0 || fMaxTDca>=0 || fMinLDca>=0.0 || fMaxLDca>=0) {
+ dcaref.Form(" (%.01f,%.01f,%.01f)", fDCAReference[0], fDCAReference[1], fDCAReference[2]);
+ }
+
if (numberOfTracks>=fMinTracks) {
description.Form("Event contains %d track(s) with ", numberOfTracks);
description+=ptcut;
+ description+=op1st;
+ description+=ldca;
+ description+=op2nd;
+ description+=tdca;
+ description+=dcaref;
SetDescription(description.Data());
// Enable the central detectors for readout.
GetReadoutList().Enable(
TriggerEvent(true);
return 0;
}
- description.Form("No tracks matching the tresholds found in the central barrel (min tracks %d, %s)",
- fMinTracks, ptcut.Data());
+ description.Form("No tracks matching the tresholds found in the central barrel (min tracks %d, ", fMinTracks);
+ description+=ptcut;
+ description+=op1st;
+ description+=ldca;
+ description+=op2nd;
+ description+=tdca;
+ description+=dcaref;
+ description+=")";
} else {
description.Form("No input blocks found");
}
}
template<class T>
-bool AliHLTTriggerBarrelMultiplicity::CheckCondition(T* track)
+bool AliHLTTriggerBarrelMultiplicity::CheckCondition(T* track, float b)
{
// see header file for class documentation
- if (track && track->Pt() >= fPtMin &&
- (fPtMax<=fPtMin || track->Pt() < fPtMax)) {
- return true;
+ if (!track) return false;
+
+ // check on ptransverse momentum
+ if (TMath::Abs(track->Pt()) < fPtMin || (fPtMax>fPtMin && TMath::Abs(track->Pt()) > fPtMax)) {
+ return false;
+ }
+
+ // check on transverse and longitudinal DCA
+ if (fMinTDca>=0.0 || fMaxTDca>=0 || fMinLDca>=0.0 || fMaxLDca>=0) {
+ Float_t dz[2]={0.0,0.0};
+ track->GetDZ(fDCAReference[0], fDCAReference[1], fDCAReference[2], b, dz);
+ HLTDebug("checking dca condition: transversal %f logitudinal %f", dz[0], dz[1]);
+ if (fMinTDca>=0 && TMath::Abs(dz[0])<fMinTDca) return false;
+ if (fMaxTDca>=0 && TMath::Abs(dz[0])>fMaxTDca) return false;
+ if (fMinLDca>=0 && TMath::Abs(dz[1])<fMinLDca) return false;
+ if (fMaxLDca>=0 && TMath::Abs(dz[1])>fMaxLDca) return false;
}
- return false;
+
+ return true;
}
int AliHLTTriggerBarrelMultiplicity::DoInit(int argc, const char** argv)
// see header file for class documentation
// first configure the default
- int iResult=ConfigureFromCDBTObjString(fgkOCDBEntry);
+ int iResult=0;
+ iResult=ConfigureFromCDBTObjString(kAliHLTCDBSolenoidBz);
+ if (iResult>=0) iResult=ConfigureFromCDBTObjString(fgkOCDBEntry);
// configure from the command line parameters if specified
if (iResult>=0 && argc>0)
// configure from the specified antry or the default one
const char* entry=cdbEntry;
- if (!entry || entry[0]==0) entry=fgkOCDBEntry;
+ if (!entry || entry[0]==0) {
+ ConfigureFromCDBTObjString(kAliHLTCDBSolenoidBz);
+ entry=fgkOCDBEntry;
+ }
return ConfigureFromCDBTObjString(entry);
}
+int AliHLTTriggerBarrelMultiplicity::ReadPreprocessorValues(const char* /*modules*/)
+{
+ // see header file for class documentation
+
+ // TODO 2009-09-10: implementation
+ // for the moment very quick, just reload the magnetic field
+ return ConfigureFromCDBTObjString(kAliHLTCDBSolenoidBz);
+}
+
int AliHLTTriggerBarrelMultiplicity::ScanConfigurationArgument(int argc, const char** argv)
{
// see header file for class documentation
fMinTracks=argument.Atoi();
return 2;
}
+
+ // -dca-reference
+ // reference point for the transverse and longitudinal dca cut
+ if (argument.CompareTo("-dca-reference")==0) {
+ if (++i>=argc) return -EPROTO;
+ argument=argv[i];
+ // scan x,y,z
+ TObjArray* pTokens=argument.Tokenize("'");
+ if (pTokens) {
+ for (int c=0; c<pTokens->GetEntriesFast() && c<fgkDCAReferenceSize; c++) {
+ argument=((TObjString*)pTokens->At(c))->GetString();
+ fDCAReference[i]=argument.Atof();
+ }
+ delete pTokens;
+ }
+ return 2;
+ }
+
+ // -min-ldca
+ // minimum longitudinal dca to reference point
+ if (argument.CompareTo("-min-ldca")==0) {
+ if (++i>=argc) return -EPROTO;
+ argument=argv[i];
+ fMinLDca=argument.Atof();
+ return 2;
+ }
+ // -max-ldca
+ // maximum longitudinal dca to reference point
+ if (argument.CompareTo("-max-ldca")==0) {
+ if (++i>=argc) return -EPROTO;
+ argument=argv[i];
+ fMaxLDca=argument.Atof();
+ return 2;
+ }
+
+ // -min-tdca
+ // minimum transverse dca to reference point
+ if (argument.CompareTo("-min-tdca")==0) {
+ if (++i>=argc) return -EPROTO;
+ argument=argv[i];
+ fMinTDca=argument.Atof();
+ return 2;
+ }
+
+ // -max-tdca
+ // maximum transverse dca to reference point
+ if (argument.CompareTo("-max-tdca")==0) {
+ if (++i>=argc) return -EPROTO;
+ argument=argv[i];
+ fMaxTDca=argument.Atof();
+ return 2;
+ }
+
+ // -solenoidBz
+ if (argument.CompareTo("-solenoidBz")==0) {
+ if (++i>=argc) return -EPROTO;
+ argument=argv[i];
+ fSolenoidBz=argument.Atof();
+ return 2;
+ }
+
// unknown argument
return -EINVAL;
}
* required minimum pt for a trigger
* \li -maxpt <i> pt </i> <br>
* required maximum pt for a trigger
+ * \li -dca-reference <i> x,y,z </i> <br>
+ * reference point for the transverse and longitudinal dca cut
+ * \li -min-ldca <i> dca </i> <br>
+ * minimum longitudinal dca to reference point
+ * \li -max-ldca <i> dca </i> <br>
+ * maximum longitudinal dca to reference point
+ * \li -min-tdca <i> dca </i> <br>
+ * minimum transverse dca to reference point
+ * \li -max-tdca <i> dca </i> <br>
+ * maximum transverse dca to reference point
+ * \li -solenoidBz <i> field </i> <br>
+ * magnetic field needed if the input is not an ESD object
*
* By default, configuration is loaded from OCDB, can be overridden by
* component arguments.
*
* <h2>Default CDB entries:</h2>
* HLT/ConfigHLT/BarrelMultiplicityTrigger: TObjString storing the arguments
+ * HLT/ConfigHLT/Solenoidbz: TObjString -solenoidBz field
*
* <h2>Performance:</h2>
*
/// inherited from AliHLTComponent: handle re-configuration event
int Reconfigure(const char* cdbEntry, const char* chainId);
+ /// inherited from AliHLTComponent: handle dcs update event
+ int ReadPreprocessorValues(const char* modules);
+
/// inherited from AliHLTComponent, scan one argument and
/// its parameters
int ScanConfigurationArgument(int argc, const char** argv);
/// check whether a track meets the criteria
template<class T>
- bool CheckCondition(T* track);
+ bool CheckCondition(T* track, float b);
/// pt cut, minimum
float fPtMin; //! transient
/// required number of tracks
int fMinTracks; //!transient
+ /// number of coordinates for the DCA reference point
+ const static short fgkDCAReferenceSize=3;
+ /// reference point for the transverse and longitudinal dca cut
+ float fDCAReference[fgkDCAReferenceSize];
+ /// minimum longitudinal dca to reference point
+ float fMinLDca;
+ /// maximum longitudinal dca to reference point
+ float fMaxLDca;
+ /// minimum transverse dca to reference point
+ float fMinTDca;
+ /// maximum transverse dca to reference point
+ float fMaxTDca;
+ /// magnetic field (dca estimation for)
+ float fSolenoidBz;
+
/// the default configuration entry for this component
static const char* fgkOCDBEntry; //!transient
--- /dev/null
+void rec_BarrelMultiplicityTrigger(const char *filename="../raw.root")
+{
+ if(!gSystem->AccessPathName("galice.root")){
+ cerr << "You have to run in a subfolder of the original data directory. If so, please delete the galice.root." << endl;
+ return;
+ }
+
+ if (!filename) {
+ cerr << "please specify input or run without arguments" << endl;
+ return;
+ }
+ // Set the CDB storage location
+ AliCDBManager * man = AliCDBManager::Instance();
+ man->SetDefaultStorage("local:///opt/HLT-public/OCDB/LHC09c");
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
+ //
+ // init the HLT system in order to define the analysis chain below
+ //
+ AliHLTSystem* gHLT=AliHLTPluginBase::GetInstance();
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
+ //
+ // define the analysis chain to be run
+ //
+ AliHLTConfiguration pubconf("hltesd-publisher", "ESDMCEventPublisher", NULL , "-entrytype HLTESD -datapath ..");
+
+ AliHLTConfiguration triggerconf("multiplicity-trigger", "BarrelMultiplicityTrigger", "hltesd-publisher" , "-max-tdca 60");
+ AliHLTConfiguration globaltriggerconf("global-trigger", "HLTGlobalTrigger", "multiplicity-trigger" , "");
+
+ // Reconstruction settings
+ AliReconstruction rec;
+
+ // QA options
+ rec.SetRunQA(":") ;
+
+ // AliReconstruction settings
+ rec.SetInput(filename);
+ //rec.SetEventRange(0,20);
+ rec.SetRunReconstruction("HLT TPC");
+ rec.SetOption("HLT", "loglevel=0x7c chains=hltesd-publisher,global-trigger ignore-hltout");
+
+ rec.Run();
+
+}