LCOV - code coverage report
Current view: top level - VZERO/VZEROrec - AliVZEROTrigger.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 58 62 93.5 %
Date: 2016-06-14 17:26:59 Functions: 5 5 100.0 %

          Line data    Source code
       1             : /**************************************************************************
       2             :  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
       3             :  *                                                                        *
       4             :  * Author: The ALICE Off-line Project.                                    *
       5             :  * Contributors are mentioned in the code where appropriate.              *
       6             :  *                                                                        *
       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             :  **************************************************************************/
      15             : /* $Id$ */
      16             : // ---------------------
      17             : // Class AliVZEROTrigger
      18             : // ---------------------
      19             : // Top class to simulate the VZERO trigger response
      20             : // This class is only used for interface with AliTriggerDetector
      21             : // Its create and Set  Inputs of the CTP
      22             : // The Calculation of the trigger response is done into AliVZEROTriggerSimulator
      23             : //
      24             : 
      25             : 
      26             : #include <TClonesArray.h>
      27             : #include <TTree.h>
      28             : 
      29             : #include "AliRun.h"
      30             : #include "AliLoader.h"
      31             : #include "AliLog.h"
      32             : #include "AliRunLoader.h"
      33             : #include "AliTriggerInput.h"
      34             : 
      35             : #include "AliVZEROdigit.h"
      36             : #include "AliVZEROTriggerSimulator.h"
      37             : #include "AliVZEROTrigger.h"
      38             : 
      39             : //______________________________________________________________________
      40          20 : ClassImp(AliVZEROTrigger)
      41             : 
      42             : //______________________________________________________________________
      43             : 
      44           8 : AliVZEROTrigger::AliVZEROTrigger():AliTriggerDetector()
      45          40 : {
      46           8 :    SetName("VZERO");
      47           8 :    CreateInputs();
      48          16 : }
      49             : //______________________________________________________________________
      50             : void AliVZEROTrigger::CreateInputs()
      51             : {
      52             :         // Do not create inputs again!!
      53          16 :         if( fInputs.GetEntriesFast() > 0 ) return;
      54             : 
      55          40 :         fInputs.AddLast( new AliTriggerInput( "VZERO_BBA_AND_BBC", "VZERO", 0 ) );
      56          40 :         fInputs.AddLast( new AliTriggerInput( "VZERO_BBA_OR_BBC","VZERO", 0 ) );
      57          40 :         fInputs.AddLast( new AliTriggerInput( "VZERO_BGA_AND_BBC",  "VZERO", 0 ) );
      58          40 :         fInputs.AddLast( new AliTriggerInput( "0VGA",   "VZERO", 0 ) );
      59          40 :         fInputs.AddLast( new AliTriggerInput( "VZERO_BGC_AND_BBA", "VZERO", 0 ) );
      60          40 :         fInputs.AddLast( new AliTriggerInput( "0VGC",   "VZERO", 0 ) );
      61          40 :         fInputs.AddLast( new AliTriggerInput( "VZERO_CTA1_AND_CTC1",   "VZERO", 0 ) );
      62          40 :         fInputs.AddLast( new AliTriggerInput( "VZERO_CTA1_OR_CTC1",   "VZERO", 0 ) );
      63          40 :         fInputs.AddLast( new AliTriggerInput( "VZERO_CTA2_AND_CTC2",   "VZERO", 0 ) );
      64          40 :         fInputs.AddLast( new AliTriggerInput( "VZERO_CTA2_OR_CTC2",   "VZERO", 0 ) );
      65          40 :         fInputs.AddLast( new AliTriggerInput( "VZERO_MTA_AND_MTC",   "VZERO", 0 ) );
      66          40 :         fInputs.AddLast( new AliTriggerInput( "VZERO_MTA_OR_MTC",   "VZERO", 0 ) );
      67          40 :         fInputs.AddLast( new AliTriggerInput( "0VBA",   "VZERO", 0 ) );
      68          40 :         fInputs.AddLast( new AliTriggerInput( "0VBC",   "VZERO", 0 ) );
      69          40 :         fInputs.AddLast( new AliTriggerInput( "VZERO_BGA_OR_BGC",   "VZERO", 0 ) );
      70          40 :         fInputs.AddLast( new AliTriggerInput( "VZERO_BEAMGAS",   "VZERO", 0 ) );
      71             : 
      72             :         // The following are kept for compatibility with the CTP configuration file. Will have to be removed at some point
      73          40 :         fInputs.AddLast( new AliTriggerInput( "VZERO_AND", "VZERO", 0 ) );
      74          40 :         fInputs.AddLast( new AliTriggerInput( "VZERO_OR","VZERO", 0 ) );
      75          16 : }
      76             : 
      77             : //______________________________________________________________________
      78             : void AliVZEROTrigger::Trigger()
      79             : {
      80             :   //  ********** Get run loader for the current event **********
      81           8 :         AliRunLoader* runLoader = AliRunLoader::Instance();
      82             : 
      83           4 :         AliLoader* loader = runLoader->GetLoader( "VZEROLoader" );
      84             : 
      85           4 :         if(!loader) {
      86           0 :                 AliError("Can not get VZERO loader");
      87           0 :                 return;
      88             :         }
      89           4 :         loader->LoadDigits("update");
      90           4 :         TTree* vzeroDigitsTree = loader->TreeD();
      91             : 
      92           4 :         if (!vzeroDigitsTree) {
      93           0 :                 AliError("Can not get the VZERO digit tree");
      94           0 :                 return;
      95             :         }
      96           4 :         TClonesArray* vzeroDigits = NULL;
      97           4 :         TBranch* digitBranch = vzeroDigitsTree->GetBranch("VZERODigit");
      98           4 :         digitBranch->SetAddress(&vzeroDigits);
      99             : 
     100           4 :         AliVZEROTriggerSimulator * triggerSimulator = new AliVZEROTriggerSimulator(vzeroDigitsTree,vzeroDigits);
     101             :         
     102             : 
     103           4 :         triggerSimulator->Run();
     104             :         
     105           4 :         loader->WriteDigits("OVERWRITE");  
     106           4 :         loader->UnloadDigits();     
     107             : 
     108           8 :         if(triggerSimulator->GetBBAandBBC()) SetInput( "VZERO_BBA_AND_BBC" );
     109           8 :         if(triggerSimulator->GetBBAorBBC())          SetInput( "VZERO_BBA_OR_BBC" );
     110           8 :         if(triggerSimulator->GetBGAandBBC()) SetInput( "VZERO_BGA_AND_BBC" );
     111           8 :         if(triggerSimulator->GetBGA())                       SetInput( "0VGA" );
     112           8 :         if(triggerSimulator->GetBGCandBBA()) SetInput( "VZERO_BGC_AND_BBA" );
     113           8 :         if(triggerSimulator->GetBGC())                       SetInput( "0VGC" );
     114           8 :         if(triggerSimulator->GetCTA1andCTC1())       SetInput( "VZERO_CTA1_AND_CTC1" );
     115           8 :         if(triggerSimulator->GetCTA1orCTC1())        SetInput( "VZERO_CTA1_OR_CTC1" );
     116           7 :         if(triggerSimulator->GetCTA2andCTC2())       SetInput( "VZERO_CTA2_AND_CTC2" );
     117           8 :         if(triggerSimulator->GetCTA1orCTC1())        SetInput( "VZERO_CTA1_OR_CTC1" );
     118           8 :         if(triggerSimulator->GetMTAandMTC()) SetInput( "VZERO_MTA_AND_MTC" );
     119           8 :         if(triggerSimulator->GetMTAorMTC())          SetInput( "VZERO_MTA_OR_MTC" );
     120           8 :         if(triggerSimulator->GetBBA())                       SetInput( "0VBA" );
     121           8 :         if(triggerSimulator->GetBBC())                       SetInput( "0VBC" );
     122           8 :         if(triggerSimulator->GetBGAorBGC())          SetInput( "VZERO_BGA_OR_BGC" );
     123           8 :         if(triggerSimulator->GetBeamGas())           SetInput( "VZERO_BEAMGAS" );
     124             : 
     125             :         // The following are kept for compatibility with the CTP configuration file. Will have to be removed at some point
     126           8 :         if(triggerSimulator->GetBBAandBBC())    SetInput( "VZERO_AND" );
     127           8 :         if(triggerSimulator->GetBBAorBBC())             SetInput( "VZERO_OR" );
     128             : 
     129             :   return;
     130           8 : }
     131             : 
     132             : 
     133             : 

Generated by: LCOV version 1.11