- // To be used on the pre-creation of Descriptors to check if the
- // conditions have valid inputs names.
- //
- // Initiate detectors modules from a Config file
- // Ask to each active module present in the fDetectorCluster
- // to create a Trigger detector and retrive the inputs from it
- // to create a list of inputs.
- // Each condition in the descriptor is then checked agains
- // the list of inputs
-
-
- if (!gAlice) {
- AliError( "no gAlice object. Restart aliroot and try again." );
- return kFALSE;
- }
- if (gAlice->Modules()->GetEntries() > 0) {
- AliError( "gAlice was already run. Restart aliroot and try again." );
- return kFALSE;
- }
-
- AliInfo( Form( "initializing gAlice with config file %s",
- configfile.Data() ) );
- StdoutToAliInfo( StderrToAliError(
- gAlice->Init( configfile.Data() );
- ););
-
- AliRunLoader* runLoader = gAlice->GetRunLoader();
- if( !runLoader ) {
- AliError( Form( "gAlice has no run loader object. "
- "Check your config file: %s", configfile.Data() ) );
- return kFALSE;
- }
-
- // get the possible inputs to check the condition
- TObjArray inputs;
- TObjArray* detArray = runLoader->GetAliRun()->Detectors();
-
- TString detStr = fDetectorCluster;
- for( Int_t iDet = 0; iDet < detArray->GetEntriesFast(); iDet++ ) {
- AliModule* det = (AliModule*) detArray->At(iDet);
- if( !det || !det->IsActive() ) continue;
- if( IsSelected( det->GetName(), detStr ) ) {
- AliInfo( Form( "Creating inputs for %s", det->GetName() ) );
- AliTriggerDetector* dtrg = det->CreateTriggerDetector();
- dtrg->CreateInputs();
- TObjArray* detInp = dtrg->GetInputs();
- for( Int_t i=0; i<detInp->GetEntriesFast(); i++ ) {
- AliInfo( Form( "Adding input %s", ((AliTriggerInput*)detInp->At(i))->GetName() ) );
- inputs.AddLast( detInp->At(i) );
- }
+ // Check if the inputs and functions
+ // satify the descriptor conditions
+
+ TString condition( GetTitle() );
+ TObjArray* tokens = condition.Tokenize(" !&|()\t");
+
+ Int_t ntokens = tokens->GetEntriesFast();
+ for( Int_t i=0; i<ntokens; i++ ) {
+ TObjString* iname = (TObjString*)tokens->At( i );
+ AliTriggerInteraction *interact = (AliTriggerInteraction *)functions.FindObject(iname->String());
+ if (interact) {
+ if (!interact->Trigger(inputs)) {
+ delete tokens;
+ return kFALSE;