X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MUON%2FAliMUONTrigger.cxx;h=2d0bd7d6ef282e90ac1429123a50f8c5810e4b5a;hb=e1bdf7813ce7d47d82d642eeddd48f884d0b63a1;hp=29b03f2be2b87d61aa3b2a25e35b00e1a85d02b9;hpb=84aac932ca789cccc36d84a8d58985e03a1fed6d;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/AliMUONTrigger.cxx b/MUON/AliMUONTrigger.cxx index 29b03f2be2b..2d0bd7d6ef2 100644 --- a/MUON/AliMUONTrigger.cxx +++ b/MUON/AliMUONTrigger.cxx @@ -15,128 +15,109 @@ /* $Id$ */ +#include + #include "AliLog.h" #include "AliRun.h" #include "AliRunLoader.h" #include "AliTriggerInput.h" #include "AliMUON.h" -#include "AliMUONLoader.h" +#include "AliMUONSimLoader.h" #include "AliMUONData.h" #include "AliMUONDigit.h" -#include "AliMUONTriggerDecision.h" +#include "AliMUONGlobalTrigger.h" #include "AliMUONTrigger.h" +/// +/// \class AliMUONTrigger +/// +/// Implementation of AliTriggerDetector for MUON detector +/// +/// So far, the inputs are taken from AliMUONTriggerDecision object +/// April 06, E.L.T. +/// May 06, taken info from Global Trigger branch (Ch.F) + //---------------------------------------------------------------------- +/// \cond CLASSIMP ClassImp(AliMUONTrigger) +/// \endcond //---------------------------------------------------------------------- AliMUONTrigger::AliMUONTrigger() : AliTriggerDetector() { +/// Default constructor + SetName("MUON"); CreateInputs(); } +//---------------------------------------------------------------------- +AliMUONTrigger::~AliMUONTrigger() +{ +/// Destructor +} + //---------------------------------------------------------------------- void AliMUONTrigger::CreateInputs() { - // inputs + /// inputs // Do not create inputs again!! if( fInputs.GetEntriesFast() > 0 ) return; - fInputs.AddLast( new AliTriggerInput( "MUON_SPlus_LPt_L0", "Single Plus Low Pt", 0x01 ) ); - fInputs.AddLast( new AliTriggerInput( "MUON_SPlus_HPt_L0", "Single Plus High Pt", 0x02 ) ); - fInputs.AddLast( new AliTriggerInput( "MUON_SPlus_All_L0", "Single Plus All", 0x04 ) ); - - fInputs.AddLast( new AliTriggerInput( "MUON_SMinus_LPt_L0", "Single Minus Low Pt", 0x08 ) ); - fInputs.AddLast( new AliTriggerInput( "MUON_SMinus_HPt_L0", "Single Minus High Pt", 0x10 ) ); - fInputs.AddLast( new AliTriggerInput( "MUON_SMinus_All_L0", "Single Minus All", 0x20 ) ); + fInputs.AddLast( new AliTriggerInput( "MUON_Single_LPt_L0", "Single Low Pt", 0x01 ) ); + fInputs.AddLast( new AliTriggerInput( "MUON_Single_HPt_L0", "Single High Pt", 0x02 ) ); - fInputs.AddLast( new AliTriggerInput( "MUON_SUndef_LPt_L0", "Single Undefined Low Pt", 0x40 ) ); - fInputs.AddLast( new AliTriggerInput( "MUON_SUndef_HPt_L0", "Single Undefined High Pt", 0x80 ) ); - fInputs.AddLast( new AliTriggerInput( "MUON_SUndef_All_L0", "Single Undefined All", 0x100 ) ); + fInputs.AddLast( new AliTriggerInput( "MUON_Unlike_LPt_L0", "Dimuon Unlike Sign pair Low Pt", 0x04 ) ); + fInputs.AddLast( new AliTriggerInput( "MUON_Unlike_HPt_L0", "Dimuon Unlike Sign pair High Pt", 0x08 ) ); - fInputs.AddLast( new AliTriggerInput( "MUON_Unlike_LPt_L0", "Single Unlike Sign pair Low Pt", 0x200 ) ); - fInputs.AddLast( new AliTriggerInput( "MUON_Unlike_HPt_L0", "Single Unlike Sign pair High Pt", 0x400 ) ); - fInputs.AddLast( new AliTriggerInput( "MUON_Unlike_All_L0", "Single Unlike Sign pair All", 0x800 ) ); - - fInputs.AddLast( new AliTriggerInput( "MUON_Like_LPt_L0", "Single Like Sign pair Low Pt", 0x1000 ) ); - fInputs.AddLast( new AliTriggerInput( "MUON_Like_HPt_L0", "Single Like Sign pair High Pt", 0x2000 ) ); - fInputs.AddLast( new AliTriggerInput( "MUON_Like_All_L0", "Single Like Sign pair All", 0x4000 ) ); + fInputs.AddLast( new AliTriggerInput( "MUON_Like_LPt_L0", "Dimuon Like Sign pair Low Pt", 0x10 ) ); + fInputs.AddLast( new AliTriggerInput( "MUON_Like_HPt_L0", "Dimuon Like Sign pair High Pt", 0x20 ) ); } //---------------------------------------------------------------------- void AliMUONTrigger::Trigger() { + /// sets the trigger inputs + AliMUONGlobalTrigger* globalTrigger; + TClonesArray* globalTriggerArray; AliRunLoader* runLoader = gAlice->GetRunLoader(); AliLoader * muonLoader = runLoader->GetLoader("MUONLoader"); muonLoader->LoadDigits("READ"); + // Creating MUON data container AliMUONData* muonData = new AliMUONData(muonLoader,"MUON","MUON"); - muonData->SetTreeAddress("D"); - muonData->GetDigits(); - Int_t idebug = 1; - // Creating MUONTriggerDecision - AliMUONTriggerDecision* decision = new AliMUONTriggerDecision(muonLoader ,idebug,muonData); - AliMUONDigit * mDigit; - Int_t tracks[10]; - Int_t charges[10]; - Int_t digits[7]; - - for(Int_t ichamber=10; ichamber<14; ichamber++) { - Int_t idigit, ndigits; - ndigits = (Int_t) muonData->Digits(ichamber)->GetEntriesFast(); -// printf(">>> Chamber Cathode ndigits %d %d %d\n",ichamber,icathode,ndigits); - for(idigit=0; idigit(muonData->Digits(ichamber)->At(idigit)); - digits[0] = mDigit->PadX(); - digits[1] = mDigit->PadY(); - digits[2] = mDigit->Cathode(); - digits[3] = mDigit->Signal(); - digits[4] = mDigit->Physics(); - digits[5] = mDigit->Hit(); - digits[6] = mDigit->DetElemId(); - - Int_t digitindex = 0 ; - // printf("ichamber ix iy %d %d %d \n",ichamber,mDigit->PadX(),mDigit->PadY()); - - decision->AddDigit(ichamber, tracks, charges, digits, digitindex ); - } // loop on digits - } // loop on chambers - muonData->ResetDigits(); - decision->Trigger(); - decision->ClearDigits(); - - // Set the trigger inputs = "global decision" - Int_t singlePlus[3]; // tot num of single plus - Int_t singleMinus[3]; // tot num of single minus - Int_t singleUndef[3]; // tot num of single undefined - Int_t pairUnlike[3]; // tot num of unlike-sign pairs - Int_t pairLike[3]; // tot num of like-sign pairs - decision->GetGlobalTrigger(singlePlus, singleMinus, singleUndef, pairUnlike, pairLike); - - if( singlePlus[0] ) SetInput("MUON_SPlus_LPt_L0"); - if( singlePlus[1] ) SetInput("MUON_SPlus_HPt_L0"); - if( singlePlus[2] ) SetInput("MUON_SPlus_All_L0"); - - if( singleMinus[0] ) SetInput("MUON_SMinus_LPt_L0"); - if( singleMinus[1] ) SetInput("MUON_SMinus_HPt_L0"); - if( singleMinus[2] ) SetInput("MUON_SMinus_All_L0"); - - if( singleUndef[0] ) SetInput("MUON_SUndef_LPt_L0"); - if( singleUndef[1] ) SetInput("MUON_SUndef_HPt_L0"); - if( singleUndef[2] ) SetInput("MUON_SUndef_All_L0"); + + // get global info + muonData->SetTreeAddress("GLT"); + muonData->GetTriggerD(); + globalTriggerArray = muonData->GlobalTrigger(); + if (globalTriggerArray == 0x0) { + AliWarning("No Global Trigger Array available"); + return; + } + globalTrigger = (AliMUONGlobalTrigger*)globalTriggerArray->UncheckedAt(0); + + if (globalTrigger == 0x0) { + AliWarning("No Global Trigger available"); + return; + } + // set CTP + if (globalTrigger->SingleLpt()) SetInput("MUON_Single_LPt_L0"); + if (globalTrigger->SingleHpt()) SetInput("MUON_Single_HPt_L0"); - if( pairUnlike[0] ) SetInput("MUON_Unlike_LPt_L0"); - if( pairUnlike[1] ) SetInput("MUON_Unlike_HPt_L0"); - if( pairUnlike[2] ) SetInput("MUON_Unlike_All_L0"); + if (globalTrigger->PairUnlikeLpt()) SetInput("MUON_Unlike_LPt_L0"); + if (globalTrigger->PairUnlikeHpt()) SetInput("MUON_Unlike_HPt_L0"); - if( pairLike[0] ) SetInput("MUON_Like_LPt_L0"); - if( pairLike[1] ) SetInput("MUON_Like_HPt_L0"); - if( pairLike[2] ) SetInput("MUON_Like_All_L0"); + if (globalTrigger->PairLikeLpt()) SetInput("MUON_Like_LPt_L0"); + if (globalTrigger->PairLikeHpt()) SetInput("MUON_Like_HPt_L0"); + + muonData->ResetTrigger(); + muonLoader->UnloadDigits(); + }