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 which defines defines the Trigger Configuration
20 // Trigger Configuration defines the trigger setup for a particular run
21 // We have default configurations for each running mode (Pb-Pb, p-p, p-A, Calibration, etc).
23 // All the information conained in the CTP configuration file used
24 // online during the data taking
26 // Configurations could be created and stored in local file.
27 // By default the configuration is loaded from the corresponding GRP entry
28 // inside the OCDB. There one can have one and only one configuration per run.
30 // Example how to create a Trigger Configuration:
32 // AliTriggerConfiguration config( "TEST", "Test Configuration" );
34 // // Define a Cluster Detector
35 // config.AddDetectorCluster( "VZERO ZDC MUON" );
37 // // Define the trigger conditions (see AliTriggerCondition.cxx)
38 // config.AddCondition( "VZERO_TEST1_L0 & MUON_SPlus_LPt_L0 & ZDC_TEST2_L0", // condition
39 // "VO1_M1_ZDC2", // short name
40 // "Dummy", // short description
41 // 0x0100 ); // class mask (set one bit)
43 // config.AddCondition( "VZERO_TEST2_L0 & MUON_SMinus_HPt_L0 & ZDC_TEST1_L0",
48 // config.AddCondition( "VZERO_TEST3_L0 | MUON_Unlike_LPt_L0 | ZDC_TEST3_L0",
52 // config.CheckInputsConditions("Config.C");
55 // // save the configuration to file
56 // // (default file name $ALICE_ROOT/data/triggerConfigurations.root)
57 // config.WriteConfiguration(); or config.WriteConfiguration( filename );
59 ///////////////////////////////////////////////////////////////////////////////
60 #include <Riostream.h>
65 #include <TObjArray.h>
66 #include <TObjString.h>
74 #include "AliTriggerBCMask.h"
75 #include "AliTriggerClass.h"
76 #include "AliTriggerCluster.h"
77 #include "AliTriggerConfiguration.h"
78 #include "AliTriggerDescriptor.h"
79 #include "AliTriggerInput.h"
80 #include "AliTriggerInteraction.h"
81 #include "AliTriggerPFProtection.h"
83 ClassImp(AliTriggerConfiguration)
85 const TString AliTriggerConfiguration::fgkConfigurationFileName("/data/triggerConfigurations.root");
87 //_____________________________________________________________________________
88 AliTriggerConfiguration::AliTriggerConfiguration():
100 // Default constructor
103 //_____________________________________________________________________________
104 AliTriggerConfiguration::AliTriggerConfiguration( TString & name, TString & description ):
105 TNamed( name, description ),
119 //_____________________________________________________________________________
120 AliTriggerConfiguration::~AliTriggerConfiguration()
125 fInteractions.SetOwner();
126 fInteractions.Delete();
127 fFunctions.SetOwner();
129 fPFProtections.SetOwner();
130 fPFProtections.Delete();
133 fDescriptors.SetOwner();
134 fDescriptors.Delete();
135 fClusters.SetOwner();
141 //_____________________________________________________________________________
142 Bool_t AliTriggerConfiguration::AddInput( AliTriggerInput* input )
144 // Add a trigger input to
145 // the list of the trigger inputs
146 if (fInputs.GetEntries() < kNMaxInputs) {
147 fInputs.AddLast( input );
151 AliError("CTP can handle up to 60 inputs ! Impossible to add the required input !");
156 //_____________________________________________________________________________
157 AliTriggerInput* AliTriggerConfiguration::AddInput( TString &name, TString &det,
158 UChar_t level, UInt_t signature,
161 // Add a trigger input to
162 // the list of the trigger inputs
163 AliTriggerInput *input = new AliTriggerInput(name,det,level,signature,number);
164 if (!AddInput(input)) {
172 //_____________________________________________________________________________
173 AliTriggerInteraction* AliTriggerConfiguration::AddInteraction(TString &name, TString &logic)
175 // Add a trigger interaction object to
176 // the list of the trigger interactions
177 AliTriggerInteraction *interact = new AliTriggerInteraction(name,logic);
178 if (!AddInteraction(interact)) {
186 //_____________________________________________________________________________
187 Bool_t AliTriggerConfiguration::AddInteraction(AliTriggerInteraction *interact)
189 // Add a trigger interaction object to
190 // the list of the trigger interactions
191 if (fInteractions.GetEntries() < kNMaxInteractions) {
192 if (interact->CheckInputs(fInputs)) {
193 fInteractions.AddLast( interact );
197 AliError("Invalid interaction ! Impossible to add it !");
200 AliError("CTP can handle up to 2 interactions ! Impossible to add the required interaction !");
205 //_____________________________________________________________________________
206 AliTriggerInteraction* AliTriggerConfiguration::AddFunction(TString &name, TString &logic)
208 // Add a trigger function object to
209 // the list of the trigger functions
210 AliTriggerInteraction *func = new AliTriggerInteraction(name,logic);
211 if (!AddFunction(func)) {
219 //_____________________________________________________________________________
220 Bool_t AliTriggerConfiguration::AddFunction(AliTriggerInteraction *func)
222 // Add a trigger function object to
223 // the list of the trigger functions
224 if (fFunctions.GetEntries() < kNMaxFunctions) {
225 if (func->CheckInputs(fInputs)) {
226 fFunctions.AddLast( func );
230 AliError("Invalid logical function ! Impossible to add it !");
233 AliError("CTP can handle up to 2 logical functions ! Impossible to add the required interaction !");
238 //_____________________________________________________________________________
239 Bool_t AliTriggerConfiguration::AddPFProtection( AliTriggerPFProtection* pfp )
241 // Add a trigger past-future protection object to
242 // the list of the trigger past-future protections
243 if (fPFProtections.GetEntries() < kNMaxPFProtections) {
244 if (pfp->CheckInteractions(fInteractions)) {
245 fPFProtections.AddLast( pfp );
249 AliError("Invalid past-future protection ! Impossible to add it !");
252 AliError("CTP can handle up to 4 past-future protections ! Impossible to add the required protection !");
257 //_____________________________________________________________________________
258 AliTriggerBCMask* AliTriggerConfiguration::AddMask( TString &name, TString &mask )
260 // Add a trigger bunch-crossing mask object to
261 // the list of the trigger bunch-crossing masks
262 AliTriggerBCMask *bcmask = new AliTriggerBCMask(name,mask);
263 if (!AddMask(bcmask)) {
271 //_____________________________________________________________________________
272 Bool_t AliTriggerConfiguration::AddMask( AliTriggerBCMask* mask )
274 // Add a trigger bunch-crossing mask object to
275 // the list of the trigger bunch-crossing masks
276 if (fMasks.GetEntries() < (kNMaxMasks+1)) { //+1 to account for NONE
277 fMasks.AddLast( mask );
281 AliError("CTP can handle up to 4 bunch-crossing masks ! Impossible to add the required mask !");
286 //_____________________________________________________________________________
287 AliTriggerCluster* AliTriggerConfiguration::AddCluster( TString &name, UChar_t index, TString &detectors)
289 // Add a trigger detector readout cluster to
290 // the list of the trigger clusters
291 AliTriggerCluster *clust = new AliTriggerCluster(name,index,detectors);
292 if (!AddCluster(clust)) {
301 //_____________________________________________________________________________
302 Bool_t AliTriggerConfiguration::AddCluster( AliTriggerCluster* cluster )
304 // Add a trigger detector readout cluster to
305 // the list of the trigger clusters
306 if (fClusters.GetEntries() < kNMaxClusters) {
307 TString dets(cluster->GetDetectorsInCluster());
308 if (!(dets.IsNull())) {
309 fClusters.AddLast( cluster );
313 AliError("Empty trigger cluster ! Impossible to add it !");
316 AliError("CTP can handle up to 6 different detector clusters ! Impossible to add the required cluster !");
321 //_____________________________________________________________________________
322 TString AliTriggerConfiguration::GetActiveDetectors() const
324 // Return an string with all active detector
327 TString activeDet = "";
329 Int_t nclus = fClusters.GetEntriesFast();
330 if( !nclus ) return activeDet;
332 for( Int_t j=0; j<nclus; ++j ) {
333 TString detStr = ((AliTriggerCluster*)fClusters.At(j))->GetDetectorsInCluster();
334 TObjArray* det = detStr.Tokenize(" ");
335 Int_t ndet = det->GetEntriesFast();
336 for( Int_t k=0; k<ndet; ++k ) {
337 if( activeDet.Contains( ((TObjString*)det->At(k))->String() ) )continue;
338 activeDet.Append( " " );
339 activeDet.Append( ((TObjString*)det->At(k))->String() );
345 //_____________________________________________________________________________
346 TString AliTriggerConfiguration::GetTriggeringDetectors() const
348 // Return an string with all detectors
349 // used for triggering
353 Int_t ninputs = fInputs.GetEntriesFast();
354 if( !ninputs ) return trDet;
356 for( Int_t j=0; j<ninputs; j++ ) {
357 TString detStr = ((AliTriggerInput*)fInputs.At(j))->GetDetector();
358 if( trDet.Contains( detStr ) ) continue;
360 trDet.Append( detStr );
365 //_____________________________________________________________________________
366 TString AliTriggerConfiguration::GetTriggeringModules() const
368 // Return an string with all detectors (modules in the AliRoot
369 // simulation sense) used for triggering
373 Int_t ninputs = fInputs.GetEntriesFast();
374 if( !ninputs ) return trDet;
376 for( Int_t j=0; j<ninputs; j++ ) {
377 TString detStr = ((AliTriggerInput*)fInputs.At(j))->GetModule();
378 if( trDet.Contains( detStr ) ) continue;
380 trDet.Append( detStr );
385 //_____________________________________________________________________________
386 AliTriggerDescriptor* AliTriggerConfiguration::AddDescriptor( TString &name, TString &cond )
388 // Add a trigger descriptor to
389 // the list of the trigger descriptors
390 AliTriggerDescriptor *desc = new AliTriggerDescriptor(name,cond);
391 if (!AddDescriptor(desc)) {
399 //_____________________________________________________________________________
400 Bool_t AliTriggerConfiguration::AddDescriptor( AliTriggerDescriptor *desc )
402 // Add a trigger descriptor to
403 // the list of the trigger descriptors
404 if (fDescriptors.GetEntries() < kNMaxClasses) {
405 if (desc->CheckInputsAndFunctions(fInputs,fFunctions)) {
406 fDescriptors.AddLast( desc );
410 AliError("Invalid trigger desciptor ! Impossible to add it !");
413 AliError("CTP can handle up to 50 different descriptors ! Impossible to add the required descriptor !");
418 //_____________________________________________________________________________
419 Bool_t AliTriggerConfiguration::AddClass( AliTriggerClass *trclass )
421 // Add a trigger class to
422 // the list of the trigger classes
423 if (fClasses.GetEntries() < kNMaxClasses) {
424 if (trclass->CheckClass(this)) {
425 fClasses.AddLast( trclass );
429 AliError("Invalid trigger class ! Impossible to add it !");
432 AliError("CTP can handle up to 50 different classes ! Impossible to add the required class !");
437 //_____________________________________________________________________________
438 AliTriggerClass *AliTriggerConfiguration::AddClass( TString &name, UChar_t index,
439 AliTriggerDescriptor *desc, AliTriggerCluster *clus,
440 AliTriggerPFProtection *pfp, AliTriggerBCMask *mask,
441 UInt_t prescaler, Bool_t allrare)
443 // Add a trigger class to
444 // the list of the trigger classes
445 if (!fDescriptors.FindObject(desc)) {
446 AliError("Invalid descriptor ! Impossible to add the class !");
449 if (!fClusters.FindObject(clus)) {
450 AliError("Invalid cluster ! Impossible to add the class !");
453 if (!fPFProtections.FindObject(pfp)) {
454 AliError("Invalid past-future protection ! Impossible to add the class !");
457 if (!fMasks.FindObject(mask)) {
458 AliError("Invalid bunch-crossing mask ! Impossible to add the class !");
461 AliTriggerClass* trclass = new AliTriggerClass( name,index,desc,clus,pfp,mask,prescaler,allrare );
462 if (!AddClass(trclass)) {
470 //_____________________________________________________________________________
471 AliTriggerClass *AliTriggerConfiguration::AddClass( TString &name, UChar_t index,
472 TString &desc, TString &clus,
473 TString &pfp, TString &mask,
474 UInt_t prescaler, Bool_t allrare)
476 // Add a new trigger class
477 if (!fDescriptors.FindObject(desc)) {
478 AliError("Invalid descriptor ! Impossible to add the class !");
481 if (!fClusters.FindObject(clus)) {
482 AliError("Invalid cluster ! Impossible to add the class !");
485 if (!fPFProtections.FindObject(pfp)) {
486 AliError("Invalid past-future protection ! Impossible to add the class !");
489 if (!fMasks.FindObject(mask)) {
490 AliError("Invalid bunch-crossing mask ! Impossible to add the class !");
493 AliTriggerClass* trclass = new AliTriggerClass( this, name,index,desc,clus,pfp,mask,prescaler,allrare );
494 if (!AddClass(trclass)) {
502 //_____________________________________________________________________________
503 Bool_t AliTriggerConfiguration::ProcessConfigurationLine(const char* line, Int_t& level)
505 // processes one line of configuration
507 TString strLine(line);
509 if (strLine.BeginsWith("#")) return kTRUE;
510 if (strLine.BeginsWith("PARTITION:")) {
511 strLine.ReplaceAll("PARTITION:","");
512 SetName(strLine.Data());
515 if (strLine.BeginsWith("VERSION:")) {
516 strLine.ReplaceAll("VERSION:","");
517 fVersion = strLine.Atoi();
520 if (strLine.BeginsWith("INPUTS:")) {
524 if (strLine.BeginsWith("INTERACTIONS:")) {
528 if (strLine.BeginsWith("DESCRIPTORS:")) {
532 if (strLine.BeginsWith("CLUSTERS:")) {
536 if (strLine.BeginsWith("PFS:")) {
540 if (strLine.BeginsWith("BCMASKS:")) {
544 if (strLine.BeginsWith("CLASSES:")) {
549 strLine.ReplaceAll("*",'!');
550 strLine.ReplaceAll("~",'!');
551 TObjArray *tokens = strLine.Tokenize(" \t");
552 Int_t ntokens = tokens->GetEntriesFast();
562 AliError(Form("Invalid trigger input syntax (%s)!",strLine.Data()));
565 AddInput(((TObjString*)tokens->At(0))->String(),
566 ((TObjString*)tokens->At(1))->String(),
567 ((TObjString*)tokens->At(2))->String().Atoi(),
568 ((TObjString*)tokens->At(3))->String().Atoi(),
569 ((TObjString*)tokens->At(4))->String().Atoi());
574 AliError(Form("Invalid trigger interaction syntax (%s)!",strLine.Data()));
577 AddInteraction(((TObjString*)tokens->At(0))->String(),
578 ((TObjString*)tokens->At(1))->String());
581 // Read logical functions and descriptors
583 if ((((TObjString*)tokens->At(0))->String().CompareTo("EMPTY") == 0) ||
584 (((TObjString*)tokens->At(0))->String().CompareTo("DTRUE") == 0) ||
585 (((TObjString*)tokens->At(0))->String().CompareTo("DEMPTY") == 0)) {
586 AddDescriptor(((TObjString*)tokens->At(0))->String(),
587 strLine.ReplaceAll(((TObjString*)tokens->At(0))->String(),""));
591 AliError(Form("Invalid trigger descriptor syntax (%s)!",strLine.Data()));
595 if (((TObjString*)tokens->At(0))->String().BeginsWith("l0f")) {
597 AddFunction(((TObjString*)tokens->At(0))->String(),
598 strLine.ReplaceAll(((TObjString*)tokens->At(0))->String(),""));
601 AddDescriptor(((TObjString*)tokens->At(0))->String(),
602 strLine.ReplaceAll(((TObjString*)tokens->At(0))->String(),""));
608 AliError(Form("Invalid trigger cluster syntax (%s)!",strLine.Data()));
611 if (((TObjString*)tokens->At(1))->String().Atoi() <= 0) {
612 AliError(Form("Invalid trigger cluster syntax (%s)!",strLine.Data()));
616 for(Int_t i = 2; i < ntokens; i++) {
617 strTemp += ((TObjString*)tokens->At(i))->String();
620 AddCluster(((TObjString*)tokens->At(0))->String(),
621 ((TObjString*)tokens->At(1))->String().Atoi(),
627 AliTriggerPFProtection *pfp = NULL;
628 if ((((TObjString*)tokens->At(0))->String().CompareTo("NONE") == 0) ||
629 (((TObjString*)tokens->At(0))->String().CompareTo("NOPF") == 0)) {
630 pfp = new AliTriggerPFProtection(((TObjString*)tokens->At(0))->String());
634 AliError(Form("Invalid trigger pfs syntax (%s)!",strLine.Data()));
637 pfp = new AliTriggerPFProtection(((TObjString*)tokens->At(0))->String(),
638 ((TObjString*)tokens->At(1))->String(),
639 ((TObjString*)tokens->At(2))->String(),
640 ((TObjString*)tokens->At(3))->String());
641 pfp->SetNa1(((TObjString*)tokens->At(4))->String().Atoi());
642 pfp->SetNa2(((TObjString*)tokens->At(5))->String().Atoi());
643 pfp->SetNb1(((TObjString*)tokens->At(6))->String().Atoi());
644 pfp->SetNb2(((TObjString*)tokens->At(7))->String().Atoi());
645 pfp->SetTa(((TObjString*)tokens->At(8))->String().Atoi());
646 pfp->SetTb(((TObjString*)tokens->At(9))->String().Atoi());
648 AddPFProtection(pfp);
653 AliError(Form("Invalid trigger bcmasks syntax (%s)!",strLine.Data()));
656 if (((TObjString*)tokens->At(0))->String().CompareTo("NONE") == 0)
658 AddMask(new AliTriggerBCMask(((TObjString*)tokens->At(0))->String()));
661 AddMask(((TObjString*)tokens->At(0))->String(),
662 ((TObjString*)tokens->At(1))->String());
667 if ((ntokens < 8) || (ntokens >10)) {
668 AliError(Form("Invalid trigger class syntax (%s)!",strLine.Data()));
671 AliTriggerClass *trclass = new AliTriggerClass(this,
672 ((TObjString*)tokens->At(0))->String(),((TObjString*)tokens->At(1))->String().Atoi(),
673 ((TObjString*)tokens->At(2))->String(),((TObjString*)tokens->At(3))->String(),
674 ((TObjString*)tokens->At(4))->String(),((TObjString*)tokens->At(5))->String(),
675 ((TObjString*)tokens->At(6))->String().Atoi(),(Bool_t)(((TObjString*)tokens->At(7))->String().Atoi()));
686 //_____________________________________________________________________________
687 AliTriggerConfiguration* AliTriggerConfiguration::LoadConfiguration(TString & configuration)
689 // Load one pre-created Configurations from database/file that match
690 // with the input string 'configuration'
691 // Ej: "Pb-Pb" or "p-p-DIMUON CALIBRATION-CENTRAL-BARREL"
692 // By default the files are stored in GRP/CTP folder.
693 // The filename is constructed as: GRP/CTP/<configuration>.cfg
695 // Load the selected configuration
697 if (configuration.EndsWith(".cfg") ||
698 configuration.EndsWith(".shuttle")) {
699 filename = configuration;
702 filename = gSystem->Getenv("ALICE_ROOT");
703 filename += "/GRP/CTP/";
704 filename += configuration;
708 if( gSystem->AccessPathName( filename.Data() ) ) {
709 AliErrorClass( Form( "file (%s) not found", filename.Data() ) );
714 ifstream *file = new ifstream ( filename.Data() );
716 AliErrorClass(Form("Error opening file (%s) !",filename.Data()));
722 AliTriggerConfiguration *cfg = new AliTriggerConfiguration();
727 while (strLine.ReadLine(*file)) {
728 if (cfg->ProcessConfigurationLine(strLine, level) == kFALSE)
742 //_____________________________________________________________________________
743 AliTriggerConfiguration* AliTriggerConfiguration::LoadConfigurationFromString(const char* configuration)
745 // Loads configuration given as parameter <configuration>
750 AliTriggerConfiguration *cfg = new AliTriggerConfiguration();
754 TObjArray* tokens = TString(configuration).Tokenize("\n");
755 for (Int_t i=0; i<tokens->GetEntries(); i++)
757 TObjString* str = dynamic_cast<TObjString*>(tokens->At(i));
761 if (cfg->ProcessConfigurationLine(str->String(), level) == kFALSE)
774 //_____________________________________________________________________________
775 TObjArray* AliTriggerConfiguration::GetAvailableConfigurations( const char* filename )
777 // Return an array of configuration in the file
781 path += gSystem->Getenv( "ALICE_ROOT" );
782 path += fgkConfigurationFileName;
787 if( gSystem->AccessPathName( path.Data() ) ) {
788 AliErrorGeneral( "AliTriggerConfiguration", Form( "file (%s) not found", path.Data() ) );
792 TObjArray* desArray = new TObjArray();
794 TFile file( path.Data(), "READ" );
795 if( file.IsZombie() ) {
796 AliErrorGeneral( "AliTriggerConfiguration", Form( "Error opening file (%s)", path.Data() ) );
803 TIter next( file.GetListOfKeys() );
804 while( (key = (TKey*)next()) ) {
805 TObject* obj = key->ReadObj();
806 if( obj->InheritsFrom( "AliTriggerConfiguration" ) ) {
807 desArray->AddLast( obj );
815 //_____________________________________________________________________________
816 void AliTriggerConfiguration::WriteConfiguration( const char* filename )
818 // Write the configuration
821 path += gSystem->Getenv("ALICE_ROOT");
822 path += fgkConfigurationFileName;
827 TFile file( path.Data(), "UPDATE" );
828 if( file.IsZombie() ) {
829 AliErrorGeneral( "AliTriggerConfiguration",
830 Form( "Can't open file (%s)", path.Data() ) );
834 Bool_t result = (Write( GetName(), TObject::kOverwrite ) != 0);
836 AliErrorGeneral( "AliTriggerConfiguration",
837 Form( "Can't write entry to file <%s>!", path.Data() ) );
841 //_____________________________________________________________________________
842 Int_t AliTriggerConfiguration::GetClassIndexFromName(const char* className) const
844 //const TObjArray& classes = cfg->GetClasses();
845 Int_t nclasses = (Int_t)fClasses.GetEntriesFast();
846 for (Int_t i=0;i<nclasses;i++) {
847 AliTriggerClass* trgclass = (AliTriggerClass*)fClasses.At(i);
848 if (TString(trgclass->GetName()).CompareTo(className) == 0) {
849 ULong64_t classmask = (ULong64_t)trgclass->GetMask();
850 return TMath::Nint(TMath::Log2(classmask))+1;
855 //_____________________________________________________________________________
856 const char* AliTriggerConfiguration::GetClassNameFromIndex(Int_t classIndex) const
858 Int_t nclasses = (Int_t)fClasses.GetEntriesFast();
859 for (Int_t i=0;i<nclasses;i++) {
860 AliTriggerClass* trgclass = (AliTriggerClass*)fClasses.At(i);
861 ULong64_t classmask = (ULong64_t)trgclass->GetMask();
862 if (TMath::Nint(TMath::Log2(classmask))+1 == classIndex) return trgclass->GetName();
866 //_____________________________________________________________________________
867 AliTriggerClass* AliTriggerConfiguration::GetTriggerClass(Int_t classIndex) const
869 Int_t nclasses = (Int_t)fClasses.GetEntriesFast();
870 for (Int_t i=0;i<nclasses;i++) {
871 AliTriggerClass* trgclass = (AliTriggerClass*)fClasses.At(i);
872 ULong64_t classmask = (ULong64_t)trgclass->GetMask();
873 if (TMath::Nint(TMath::Log2(classmask))+1 == classIndex) return trgclass;
877 //_____________________________________________________________________________
878 void AliTriggerConfiguration::Reset()
880 for( Int_t j=0; j<fInputs.GetEntriesFast(); j++ )
881 ((AliTriggerInput*)fInputs.At(j))->Reset();
883 for( Int_t j=0; j<fClasses.GetEntriesFast(); j++ )
884 ((AliTriggerClass*)fClasses.At(j))->Reset();
887 //_____________________________________________________________________________
888 void AliTriggerConfiguration::Print( const Option_t* ) const
891 cout << "#################################################" << endl;
892 cout << "Trigger Configuration:" << endl;
893 cout << " Name: " << GetName() << endl;
894 cout << " Description: " << GetTitle() << endl;
895 cout << " Version: " << GetVersion() << endl;
896 cout << " Active Detectors: " << GetActiveDetectors() << endl;
897 cout << " Trigger Detectors: " << GetTriggeringDetectors() << endl;
899 cout << "#################################################" << endl;
901 cout << "#################################################" << endl;
902 fInteractions.Print();
903 cout << "#################################################" << endl;
905 cout << "#################################################" << endl;
906 fDescriptors.Print();
907 cout << "#################################################" << endl;
909 cout << "#################################################" << endl;
910 fPFProtections.Print();
911 cout << "#################################################" << endl;
913 cout << "#################################################" << endl;
915 cout << "#################################################" << endl;
921 //////////////////////////////////////////////////////////////////////////////
924 //_____________________________________________________________________________
925 Bool_t AliTriggerConfiguration::IsSelected( TString detName, TString& detectors ) const
927 // check whether detName is contained in detectors
928 // if yes, it is removed from detectors
930 // check if all detectors are selected
931 if( (detectors.CompareTo("ALL") == 0 ) ||
932 detectors.BeginsWith("ALL ") ||
933 detectors.EndsWith(" ALL") ||
934 detectors.Contains(" ALL ") ) {
939 // search for the given detector
940 Bool_t result = kFALSE;
941 if( (detectors.CompareTo( detName ) == 0) ||
942 detectors.BeginsWith( detName+" " ) ||
943 detectors.EndsWith( " "+detName ) ||
944 detectors.Contains( " "+detName+" " ) ) {
945 detectors.ReplaceAll( detName, "" );
949 // clean up the detectors string
950 while( detectors.Contains(" ") ) detectors.ReplaceAll( " ", " " );
951 while( detectors.BeginsWith(" ") ) detectors.Remove( 0, 1 );
952 while( detectors.EndsWith(" ") ) detectors.Remove( detectors.Length()-1, 1 );