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 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////////
20 // Class to define a Trigger Input from an specific detector //
23 // name description id mask
25 // AliTriggerInput( "V0_MB_L0", "VO minimum bias", 0x01 );
26 // AliTriggerInput( "V0_SC_L0", "VO semi central", 0x02 );
27 // AliTriggerInput( "V0_C_L0", "VO central", 0x04 );
29 // The name must be globaly unique. Spaces are not allowed.
30 // As convention should start with detector name then an id
31 // and the trigger level (L0, L1, L2) separated by "_"
32 // for valid detector names see AliTriggerCluster::fgkDetectorName
34 // A maximun of 60 inputs trigger are allow.
35 // So, the id mask should set only bit from the position 1 to 60.
37 ///////////////////////////////////////////////////////////////////////////////
39 #include <Riostream.h>
43 #include "AliTriggerInput.h"
45 ClassImp( AliTriggerInput )
47 Bool_t AliTriggerInput::fgkIsTriggerDetector[AliDAQ::kNDetectors] = {1,0,0,0,1,1,0,1,0,0,0,1,0,1,1,1,1,1,1,0};
48 const char* AliTriggerInput::fgkCTPDetectorName[AliDAQ::kNDetectors] = {
71 const char* AliTriggerInput::fgkOfflineModuleName[AliDAQ::kNDetectors] = {
94 //_____________________________________________________________________________
95 AliTriggerInput::AliTriggerInput( TString name, TString det, UChar_t level, Int_t signature, Char_t number ):
96 TNamed( name.Data(), det.Data() ),
97 fMask((number >= 0) ? 1 << number : 0 ),
99 fSignature(signature),
104 // Standard constructor
106 // The name must be globaly unique. Spaces are not allowed.
107 // For valid detector names see AliDAQ::fgkDetectorName
109 // Check for valid detector name
111 for( iDet = 0; iDet < AliDAQ::kNDetectors; iDet++ ) {
112 if( !fgkIsTriggerDetector[iDet] ) continue;
113 if( det.CompareTo( fgkCTPDetectorName[iDet] ) == 0 ) {
114 fTitle = AliDAQ::DetectorName(iDet);
118 if( det.CompareTo( AliDAQ::DetectorName(iDet) ) == 0 ) {
123 if( iDet == AliDAQ::kNDetectors ) {
124 AliError( Form( "%s is not a valid trigger input, it must contain a valid trigger detector name instead of (%s)", name.Data(), det.Data() ) );
128 //_____________________________________________________________________________
129 void AliTriggerInput::Print( const Option_t* ) const
132 cout << "Trigger Input:" << endl;
133 cout << " Name: " << GetName() << endl;
134 cout << " Detector: " << GetTitle() << "(Id=" << (Int_t)fDetectorId << ")" << endl;
135 cout << " Level: " << fLevel << endl;
136 cout << " Signature: " << fSignature << endl;
137 cout << " Number: " << (Int_t)TMath::Log2(fMask) << endl;
139 cout << " Input is active " << endl;
141 cout << " Input is not active " << endl;
143 cout << " Input is fired " << endl;
145 cout << " Input is not fired " << endl;
148 //_____________________________________________________________________________
149 TString AliTriggerInput::GetModule() const
151 // Get the detector module name (in AliRoot simulation sense)
153 if (fDetectorId >= 0 && fDetectorId < AliDAQ::kNDetectors)
154 name = fgkOfflineModuleName[(Int_t)fDetectorId];
156 AliError(Form("Invalid detector Id (%d)",(Int_t)fDetectorId));