- Speed-up of the trigger response calculation (factor of about 4 in cosmic runs, resulting in a factor of 2 for the Trigger QA MakeRaws).
(Diego)
#include "AliMUONRawStreamTrackerHP.h"
#include "AliMUONRawStreamTriggerHP.h"
#include "AliMUONRegHeader.h"
-#include "AliMUONTriggerCircuit.h"
#include "AliMUONVTriggerStore.h"
#include "AliMpDetElement.h"
#include "AliMpTriggerCrate.h"
track.SetChi2MatchTrigger(esdTrack.GetChi2MatchTrigger());
track.SetHitsPatternInTrigCh(esdTrack.GetHitsPatternInTrigCh());
track.SetLocalTrigger(esdTrack.LoCircuit(), esdTrack.LoStripX(), esdTrack.LoStripY(),
- esdTrack.LoDev(), esdTrack.LoLpt(), esdTrack.LoHpt());
+ esdTrack.LoDev(), esdTrack.LoLpt(), esdTrack.LoHpt(),
+ esdTrack.GetTriggerWithoutChamber());
// track parameters at vertex
AliMUONTrackParam paramAtVertex;
locTrg.SetDeviation(esdTrack.LoDev());
locTrg.SetLoLpt(esdTrack.LoLpt());
locTrg.SetLoHpt(esdTrack.LoHpt());
+ locTrg.SetTriggerWithoutChamber(esdTrack.GetTriggerWithoutChamber());
locTrg.SetLoTrigY(1);
locTrg.SetX1Pattern(esdTrack.GetTriggerX1Pattern());
locTrg.SetX2Pattern(esdTrack.GetTriggerX2Pattern());
locTrg.LoStripY(),
locTrg.GetDeviation(),
locTrg.LoLpt(),
- locTrg.LoHpt());
+ locTrg.LoHpt(),
+ locTrg.GetTriggerWithoutChamber());
esdTrack.SetLocalTrigger(muonTrack.GetLocalTrigger());
esdTrack.SetChi2MatchTrigger(0.);
esdTrack.SetTriggerX1Pattern(locTrg.GetX1Pattern());
#include "AliMUONLocalTrigger.h"
#include "AliLog.h"
#include "AliMUONLocalStruct.h"
+#include "AliMUONRawStreamTriggerHP.h"
#include <Riostream.h>
#include <TArrayS.h>
fY1Pattern(0),
fY2Pattern(0),
fY3Pattern(0),
- fY4Pattern(0)
+ fY4Pattern(0),
+
+ fHitPatternFromResponse(0xFF),
+ fTriggerWithoutChamber(0)
{
/// Default constructor
}
fY1Pattern(theMUONLocalTrig.fY1Pattern),
fY2Pattern(theMUONLocalTrig.fY2Pattern),
fY3Pattern(theMUONLocalTrig.fY3Pattern),
- fY4Pattern(theMUONLocalTrig.fY4Pattern)
+ fY4Pattern(theMUONLocalTrig.fY4Pattern),
+
+ fHitPatternFromResponse(theMUONLocalTrig.fHitPatternFromResponse),
+ fTriggerWithoutChamber(theMUONLocalTrig.fTriggerWithoutChamber)
{
/// Copy constructor (useful for TClonesArray)
fY3Pattern = theMUONLocalTrig.fY3Pattern;
fY4Pattern = theMUONLocalTrig.fY4Pattern;
+ fHitPatternFromResponse = theMUONLocalTrig.fHitPatternFromResponse;
+ fTriggerWithoutChamber = theMUONLocalTrig.fTriggerWithoutChamber;
+
return *this;
}
/// Trigger response Y strips
Bool_t IsTrigY();
+ /// Hit pattern from the re-calculated trigger response after removing chambers one-by-one
+ UShort_t GetHitPatternFromResponse() const {return fHitPatternFromResponse; }
+
+ /// Triggers from the re-calculated trigger response after removing chambers one-by-one
+ UChar_t GetTriggerWithoutChamber() const {return fTriggerWithoutChamber; }
+
// setter methods
//
/// Set Circuit number
virtual void Print(Option_t* opt="") const;
virtual const char* GetName() const;
-
+
+ /// The board would provide a trigger even after removing chamber ich [0,3]
+ void SetTriggerWithoutChamber(Int_t ich){ fTriggerWithoutChamber |= 1 << (3 - ich); }
+
+ /// Trigger algorithm did NOT find hit in the specified chamber and cathode
+ void SetNoHitInPlane(Int_t icath, Int_t ich){ fHitPatternFromResponse &= ~(1 << (7 - 4*icath - ich)); }
+
private:
Int_t fLoCircuit; ///< Circuit number
Int_t fLoStripX; ///< X strip in MT11
UShort_t fY3Pattern; ///< Y strip pattern for chamber 21
UShort_t fY4Pattern; ///< Y strip pattern for chamber 22
+ UShort_t fHitPatternFromResponse; ///< Fired plane according to re-computed repsonse
+ UChar_t fTriggerWithoutChamber; ///< Pattern of triggers after chamber removal
+
ClassDef(AliMUONLocalTrigger,4) // reconstructed Local Trigger object
};
#endif
for (Int_t i=0; i<2; i++) fLutLpt[i] = fLutHpt[i] = 0;
}
+//___________________________________________
+AliMUONLocalTriggerBoard::AliMUONLocalTriggerBoard(const AliMUONLocalTriggerBoard& right) :
+ AliMUONTriggerBoard(right),
+ fMpLocalBoard(right.fMpLocalBoard),
+ fStripX11(right.fStripX11),
+ fStripY11(right.fStripY11),
+ fDev(right.fDev),
+ fTrigY(right.fTrigY),
+ fOutput(right.fOutput),
+ fLUT(right.fLUT),
+ fCoinc44(right.fCoinc44)
+{
+ //
+ /// Copy constructor
+ //
+ for (Int_t i=0; i<2; i++) {
+ for (Int_t j=0; j<4; j++) {
+ fXY[i][j] = right.fXY[i][j];
+ fXYU[i][j] = right.fXYU[i][j];
+ fXYD[i][j] = right.fXYD[i][j];
+
+ fMask[i][j] = right.fMask[i][j];
+ }
+ }
+
+ for (Int_t i=0; i<2; i++) {
+ fLutLpt[i] = right.fLutLpt[i];
+ fLutHpt[i] = right.fLutHpt[i];
+ }
+
+ for (Int_t i=0; i<5; i++) {
+ fMinDevStrip[i] = right.fMinDevStrip[i];
+ fMinDev[i] = right.fMinDev[i];
+ fCoordY[i] = right.fCoordY[i];
+ }
+}
+
+//___________________________________________
+AliMUONLocalTriggerBoard& AliMUONLocalTriggerBoard::operator=(const AliMUONLocalTriggerBoard& right)
+{
+/// Assigment operator;
+/// equal operator
+
+ if (this == &right)
+ return *this;
+
+ // base class assignement
+ AliMUONTriggerBoard::operator=(right);
+
+ fMpLocalBoard = right.fMpLocalBoard;
+ fStripX11 = right.fStripX11;
+ fStripY11 = right.fStripY11;
+ fDev = right.fDev;
+ fTrigY = right.fTrigY;
+ fOutput = right.fOutput;
+ fLUT = right.fLUT;
+ fCoinc44 = right.fCoinc44;
+
+ for (Int_t i=0; i<2; i++) {
+ for (Int_t j=0; j<4; j++) {
+ fXY[i][j] = right.fXY[i][j];
+ fXYU[i][j] = right.fXYU[i][j];
+ fXYD[i][j] = right.fXYD[i][j];
+
+ fMask[i][j] = right.fMask[i][j];
+ }
+ }
+
+ for (Int_t i=0; i<2; i++) {
+ fLutLpt[i] = right.fLutLpt[i];
+ fLutHpt[i] = right.fLutHpt[i];
+ }
+
+ for (Int_t i=0; i<5; i++) {
+ fMinDevStrip[i] = right.fMinDevStrip[i];
+ fMinDev[i] = right.fMinDev[i];
+ fCoordY[i] = right.fCoordY[i];
+ }
+
+ return *this;
+}
+
//___________________________________________
AliMUONLocalTriggerBoard::~AliMUONLocalTriggerBoard()
{
for (Int_t j=0; j<4; j++)
fXY[i][j] = fXYU[i][j] = fXYD[i][j] = 0;
- fResponse = 0;
+ ResetResponse();
+}
- for (Int_t i=0; i<5; i++) fMinDevStrip[i] = fMinDev[i] = fCoordY[i] = 0;
+//___________________________________________
+void AliMUONLocalTriggerBoard::ResetResponse()
+{
+/// reset board response
+//
+ fResponse = 0;
- fOutput = 0;
+ for (Int_t i=0; i<5; i++) fMinDevStrip[i] = fMinDev[i] = fCoordY[i] = 0;
+
+ fOutput = 0;
- fStripX11 = 0;
- fStripY11 = 15;
- fDev = 0;
- fTrigY = 1;
+ fStripX11 = 0;
+ fStripY11 = 15;
+ fDev = 0;
+ fTrigY = 1;
- for (Int_t i=0; i<2; i++) fLutLpt[i] = fLutHpt[i] = 0;
+ for (Int_t i=0; i<2; i++) fLutLpt[i] = fLutHpt[i] = 0;
}
+
//___________________________________________
void AliMUONLocalTriggerBoard::Setbit(Int_t strip, Int_t cathode, Int_t chamber)
{
if (op.Contains("RESPF")) Resp("F");
+ if (op.Contains("RESPO")) Resp("O");
+
if (op.Contains("ALL"))
{
Conf();
for (Int_t i=4; i>=0; i--) printf("%i",fCoordY[i]);
printf(" \n");
}
+ if (op.Contains("O")){
+ printf("-- Output --\n");
+ printf("Coinc44 %i\n", fCoinc44);
+ printf("StripX11 %i StripY11 %i Dev %i TrigY %i\n", fStripX11, fStripY11, fDev, fTrigY);
+ printf("LutLpt %i %i LutHpt %i %i\n", fLutLpt[0], fLutLpt[1], fLutHpt[0], fLutHpt[1]);
+ printf("Response %i\n", fOutput);
+ }
}
{
/// algo
///
+ if ( IsNull() ) {
+ fMinDev[4] = 1;
+ for (Int_t i=4; i>=0; i--) fCoordY[i] = 1;
+ return; // Do nothing if strip pattern is null
+ }
+
Int_t xX1[16], xX2[16], xXX3[32], xXX4[32];
TBits x1(16), x2(16), x3(16), x4(16);
return output;
}
+
+//___________________________________________
+Bool_t AliMUONLocalTriggerBoard::IsNull() const
+{
+ /// Check if board has fired strips in the first station
+ for (Int_t icath=0; icath<2; icath++){
+ for(Int_t ich=0; ich<2; ich++){
+ if ( fXY[icath][ich] ) return kFALSE;
+ }
+ }
+ return kTRUE;
+}
virtual void Pattern(Option_t *option = "X Y") const; // default option displays X then Y bp
virtual void Reset();
+ virtual void ResetResponse();
/// Return i-th Switch value
/// Set XYU
virtual void SetXYU(UShort_t V[2][4]) {for (Int_t i=0;i<2;i++) for (Int_t j=0;j<4;j++) fXYU[i][j] = V[i][j];}
+ /// Return XYU
+ virtual void GetXYU(UShort_t V[2][4]) const {for (Int_t i=0;i<2;i++) for (Int_t j=0;j<4;j++) V[i][j] = fXYU[i][j];}
+
/// Set XYD
virtual void SetXYD(UShort_t V[2][4]) {for (Int_t i=0;i<2;i++) for (Int_t j=0;j<4;j++) fXYD[i][j] = V[i][j];}
+ /// Return XYD
+ virtual void GetXYD(UShort_t V[2][4]) const {for (Int_t i=0;i<2;i++) for (Int_t j=0;j<4;j++) V[i][j] = fXYD[i][j];}
+
virtual void Scan(Option_t *option = "") const;
virtual Int_t GetI() const;
virtual Bool_t IsTrigY() const;
virtual Bool_t IsTrigX() const;
+
+ AliMUONLocalTriggerBoard(const AliMUONLocalTriggerBoard& right);
+ AliMUONLocalTriggerBoard& operator = (const AliMUONLocalTriggerBoard& right);
+
+ virtual Bool_t IsNull() const;
protected:
virtual void BP(Option_t *option) const; ///< display X/Y bp
private:
- /// Not implemented
- AliMUONLocalTriggerBoard(const AliMUONLocalTriggerBoard& right);
- /// Not implemented
- AliMUONLocalTriggerBoard& operator = (const AliMUONLocalTriggerBoard& right);
-
AliMpLocalBoard* fMpLocalBoard; ///< pointer to the local board mapping
UShort_t fXY[2][4]; ///< Bit pattern
#include "AliMUONVClusterFinder.h"
#include "AliMUONVClusterServer.h"
#include "AliMUONVTrackStore.h"
+#include "AliMUONTriggerElectronics.h"
#include "AliMpArea.h"
#include "AliMpCDB.h"
fClusterServer(0x0),
fTriggerStore(0x0),
fTrackStore(0x0),
-fClusterStore(0x0)
+fClusterStore(0x0),
+fTriggerProcessor(0x0)
{
/// normal ctor
delete fTriggerStore;
delete fTrackStore;
delete fClusterStore;
+ delete fTriggerProcessor;
delete AliMpSegmentation::Instance(false);
delete AliMpDDLStore::Instance(false);
//_____________________________________________________________________________
void
-AliMUONReconstructor::CreateCalibrator() const
+AliMUONReconstructor::CreateCalibrationData() const
{
/// Create the calibrator
- AliCodeTimerAuto("",0)
+ AliCodeTimerAuto("",0);
Int_t runNumber = AliCDBManager::Instance()->GetRun();
- AliInfo("Calibration will occur.");
-
fCalibrationData = new AliMUONCalibrationData(runNumber);
if ( !fCalibrationData->IsValid() )
{
}
}
}
-
+}
+
+//_____________________________________________________________________________
+void
+AliMUONReconstructor::CreateCalibrator() const
+{
+ /// Create the calibrator
+
+ AliCodeTimerAuto("",0);
+
+ if ( ! fCalibrationData )
+ CreateCalibrationData();
+
+ AliInfo("Calibration will occur.");
+
TString opt(GetOption());
opt.ToUpper();
fDigitCalibrator = new AliMUONDigitCalibrator(*fCalibrationData,GetRecoParam(),calibMode.Data());
}
+//_____________________________________________________________________________
+void
+AliMUONReconstructor::ResponseRemovingChambers(AliMUONVTriggerStore* triggerStore) const
+{
+ /// Update trigger information with informatins obtained after
+ /// re-calculation of trigger response
+ AliCodeTimerAuto("",0);
+
+ if ( ! fCalibrationData )
+ CreateCalibrationData();
+
+ if ( ! fTriggerProcessor )
+ fTriggerProcessor = new AliMUONTriggerElectronics(fCalibrationData);
+
+ fTriggerProcessor->ResponseRemovingChambers(*triggerStore);
+}
+
//_____________________________________________________________________________
AliMUONVDigitStore*
AliMUONReconstructor::DigitStore() const
if ( triggerStore )
{
+ ResponseRemovingChambers(triggerStore);
ok = triggerStore->Connect(clustersTree,alone);
if (!ok)
{
class AliMUONVDigitStore;
class AliMUONVTrackStore;
class AliMUONVTriggerStore;
-class AliMUONVTriggerStore;
+class AliMUONTriggerElectronics;
class TClonesArray;
#include "AliMUONRecoParam.h"
AliMUONVDigitStore* digitStore,
AliMUONVTriggerStore* triggerStore) const;
void Calibrate(AliMUONVDigitStore& digitStore) const;
+ void CreateCalibrationData() const;
void CreateCalibrator() const;
void CreateDigitMaker() const;
void CreateTriggerCircuit() const;
AliMUONVDigitStore* DigitStore() const;
AliMUONVTriggerStore* TriggerStore() const;
+ void ResponseRemovingChambers(AliMUONVTriggerStore* triggerStore) const;
private:
mutable AliMUONVTriggerStore* fTriggerStore; //!< Trigger container
mutable AliMUONVTrackStore* fTrackStore; //!< Track container
mutable AliMUONVClusterStore* fClusterStore; //!< cluster store (when not in combined tracking mode)
+ mutable AliMUONTriggerElectronics* fTriggerProcessor; //!< Processor to recalculate trigger response
- ClassDef(AliMUONReconstructor,8) // Implementation of AliReconstructor
+ ClassDef(AliMUONReconstructor,9) // Implementation of AliReconstructor
};
#endif
// [+, -] * [Hpt, Lpt]
// transformed to [+, -, US, LS] * [Hpt, Lpt]
+ if ( IsNull() ) return; // Do nothing if all local responses are null
+
Int_t t[16];
for (Int_t i = 0; i < 16; ++i)
rank /= 2;
}
+
fResponse = t[0]; // 8-bit [H4:L4]
}
fMask = mask;
}
+//___________________________________________
+Bool_t AliMUONRegionalTriggerBoard::IsNull()
+{
+ /// Check if all local response are null
+ for (Int_t i=0; i<16; i++) {
+ if ( fLocalResponse[i] ) return kFALSE;
+ }
+ return kTRUE;
+}
+//___________________________________________
+void AliMUONRegionalTriggerBoard::Reset()
+{
+ /// Reset board
+
+ for (Int_t i=0; i<16; ++i) fLocalResponse[i] = 0;
+
+ fResponse = 0;
+
+}
AliMUONRegionalTriggerBoard(const char *name, Int_t a);
virtual ~AliMUONRegionalTriggerBoard();
- /// Reset Local trigger inputs
- virtual void Reset() {for (Int_t i=0; i<16; i++) fLocalResponse[i] = 0;}
+ virtual void Reset();
virtual void Scan(Option_t *option) const;
/// set local boards enable
void Mask(UShort_t mask);
-
+
+ virtual Bool_t IsNull();
+
private:
UShort_t fLocalResponse[16]; ///< Local trigger inputs
UShort_t fMask; ///< Entry mask
}
//__________________________________________________________________________
-void AliMUONTrack::SetLocalTrigger(Int_t loCirc, Int_t loStripX, Int_t loStripY, Int_t loDev, Int_t loLpt, Int_t loHpt)
+void AliMUONTrack::SetLocalTrigger(Int_t loCirc, Int_t loStripX, Int_t loStripY, Int_t loDev, Int_t loLpt, Int_t loHpt, UChar_t respWithoutChamber)
{
/// pack the local trigger information and store
fLocalTrigger += loDev << 17;
fLocalTrigger += loLpt << 22;
fLocalTrigger += loHpt << 24;
+ fLocalTrigger += respWithoutChamber << 26;
}
void SetHitsPatternInTrigCh(UShort_t hitsPatternInTrigCh) {fHitsPatternInTrigCh = hitsPatternInTrigCh;}
/// set local trigger information for the matched trigger track
- void SetLocalTrigger(Int_t loCirc, Int_t loStripX, Int_t loStripY, Int_t loDev, Int_t loLpt, Int_t loHpt);
+ void SetLocalTrigger(Int_t loCirc, Int_t loStripX, Int_t loStripY, Int_t loDev, Int_t loLpt, Int_t loHpt, UChar_t respWithoutChamber=0);
/// return local trigger information for the matched trigger track
Int_t GetLocalTrigger(void) const { return fLocalTrigger; }
/// number of triggering circuit
Int_t LoLpt(void) const { return fLocalTrigger >> 22 & 0x03; }
/// high pt decision local trigger
Int_t LoHpt(void) const { return fLocalTrigger >> 24 & 0x03; }
+ /// Word stating if trigger would be fired without one chamber
+ Int_t GetTriggerWithoutChamber(void) const { return fLocalTrigger >> 26 & 0xF; }
+ /// Check if trigger would be fired without chamber (ich [0,3])
+ Bool_t TriggerFiredWithoutChamber(Int_t ich) const { return GetTriggerWithoutChamber() >> (3 - ich) & 0x1; }
void FindMCLabel();
/// set the corresponding MC track number
if (locTrg)
{
- Int_t deviation = locTrg->GetDeviation();
track->SetLocalTrigger(locTrg->LoCircuit(),
locTrg->LoStripX(),
locTrg->LoStripY(),
- deviation,
+ locTrg->GetDeviation(),
locTrg->LoLpt(),
- locTrg->LoHpt());
+ locTrg->LoHpt(),
+ locTrg->GetTriggerWithoutChamber());
}
return matchedTriggerTrack;
}
+
+//___________________________________________
+AliMUONTriggerBoard::AliMUONTriggerBoard(const AliMUONTriggerBoard &rhs)
+ : TNamed(rhs),
+ fSlot(rhs.fSlot),
+ fResponse(rhs.fResponse)
+{
+ //
+ /// Copy constructor
+ //
+}
+
+
+//___________________________________________
+AliMUONTriggerBoard& AliMUONTriggerBoard::operator=(const AliMUONTriggerBoard &rhs)
+{
+/// Assigment operator;
+
+ if (this == &rhs)
+ return *this;
+
+ // base class assignement
+ TNamed::operator=(rhs);
+
+ fSlot = rhs.fSlot;
+ fResponse = rhs.fResponse;
+
+ return *this;
+}
+
+
//___________________________________________
AliMUONTriggerBoard::~AliMUONTriggerBoard()
{
/// Return response
virtual UShort_t GetResponse() const {return fResponse;}
+ AliMUONTriggerBoard(const AliMUONTriggerBoard &rhs);
+ AliMUONTriggerBoard& operator=(const AliMUONTriggerBoard &rhs);
+
protected:
Int_t fSlot; ///< SLOT NUMBER IN CRATE
UShort_t fResponse; ///< RESPONSE
- private:
- /// Not implemented
- AliMUONTriggerBoard(const AliMUONTriggerBoard &entry);
- /// Not implemented
- AliMUONTriggerBoard& operator=(const AliMUONTriggerBoard &rhs);
-
ClassDef(AliMUONTriggerBoard,1) //Trigger board base class
};
#endif
#include <TBits.h>
#include <TSystem.h>
+#include "AliCodeTimer.h"
+
/// \cond CLASSIMP
ClassImp(AliMUONTriggerElectronics)
{
/// FILL INPUTS
///
+
+ AliCodeTimerAuto("",0);
TIter next(digitStore.CreateTriggerIterator());
AliMUONVDigit* mdig;
}
}
+ FeedCopyNeighbours();
+}
+
+
+//___________________________________________
+void AliMUONTriggerElectronics::FeedCopyNeighbours()
+{
+ //
+ /// Feed the local copies
+ /// and complete the feed with the information of neighbours
+ //
+
// Particular case of the columns with 22 local boards (2R(L) 3R(L))
// fill copy input from mapping instead of hardcoded valued (Ch.F)
AliMUONTriggerCrate *crate = 0x0; TObjArray *bs = 0x0;
void AliMUONTriggerElectronics::LocalResponse()
{
/// Compute the response for local cards
+
+ AliCodeTimerAuto("",0);
AliMUONTriggerCrate* cr;
TIter next(fCrates->CreateCrateIterator());
+
+ UShort_t thisl[16];
while ( ( cr = static_cast<AliMUONTriggerCrate*>(next()) ) )
{
AliMUONRegionalTriggerBoard *regb = (AliMUONRegionalTriggerBoard*)boards->At(0);
- UShort_t thisl[16]; for (Int_t j=0; j<16; j++) thisl[j] = 0;
+ for (Int_t j=0; j<16; ++j) thisl[j] = 0;
for (Int_t j = 1; j < boards->GetEntries(); j++)
{
if (!o) break;
AliMUONLocalTriggerBoard *board = (AliMUONLocalTriggerBoard*)o;
-
- if (board) // check if empty slot
- {
- board->Response();
-
- UShort_t response = board->GetResponse();
-
- // CRATE CONTAINING INTERFACE BOARD
- if (board->GetNumber() == 0) // copy boards
- {
- if ( response != 0 )
- AliWarning(Form("Interface board %s in slot %d of crate %s has a non zero response",
- board->GetName(),j,cr->GetName()));
- AliDebug(1, Form("local slot %d, number %d in crate %s\n", j, board->GetNumber(), cr->GetName()));
- }
+ board->Response();
+
+ UShort_t response = board->GetResponse();
- thisl[j-1] = response;
+ // CRATE CONTAINING INTERFACE BOARD
+ if (board->GetNumber() == 0) // copy boards
+ {
+ if ( response != 0 )
+ AliWarning(Form("Interface board %s in slot %d of crate %s has a non zero response",
+ board->GetName(),j,cr->GetName()));
+ AliDebug(1, Form("local slot %d, number %d in crate %s\n", j, board->GetNumber(), cr->GetName()));
+
}
- }
+
+ thisl[j-1] = response;
+ }
regb->SetLocalResponse(thisl);
}
void AliMUONTriggerElectronics::RegionalResponse()
{
/// Compute the response for all regional cards.
+
+ AliCodeTimerAuto("",0);
+
AliMUONTriggerCrate* cr;
TIter next(fCrates->CreateCrateIterator());
TObjArray *boards = cr->Boards();
AliMUONRegionalTriggerBoard *regb = (AliMUONRegionalTriggerBoard*)boards->At(0);
-
- if (regb)
- {
- regb->Response();
- }
+
+ regb->Response();
+
}
}
{
/// Compute the global response
+ AliCodeTimerAuto("",0);
+
UShort_t regional[16];
AliMUONTriggerCrate* cr;
void AliMUONTriggerElectronics::Digits2Trigger(const AliMUONVDigitStore& digitStore,
AliMUONVTriggerStore& triggerStore)
{
+ AliCodeTimerAuto("",0);
+
/// Main method to go from digits to trigger decision
AliMUONRegionalTrigger pRegTrig;
triggerStore.Clear();
+
+ // NOW RESET ELECTRONICS
+ Reset();
// RUN THE FULL BEE CHAIN
Feed(digitStore);
globalTrigger.SetFromGlobalInput(globalInput);
// ADD A LOCAL TRIGGER IN THE LIST
triggerStore.SetGlobal(globalTrigger);
-
- // NOW RESET ELECTRONICS
+
+}
+
+//___________________________________________
+void AliMUONTriggerElectronics::Feed(AliMUONVTriggerStore& triggerStore)
+{
+ //
+ /// Fill inputs from reconstructed local trigger store
+ //
+ AliMUONLocalTrigger* locTrg;
+ TIter next(triggerStore.CreateLocalIterator());
+ TArrayS xyPattern[2];
+ UShort_t xy[2][4];
+ Int_t loCircuit;
+ while ( ( locTrg = static_cast<AliMUONLocalTrigger*>( next() )) != NULL ){
+ locTrg->GetXPattern(xyPattern[0]);
+ locTrg->GetYPattern(xyPattern[1]);
+ loCircuit = locTrg->LoCircuit();
+ AliMUONLocalTriggerBoard* localBoard = fCrates->LocalBoard(loCircuit);
+ for (Int_t icath = 0; icath<2; ++icath){
+ for (Int_t ich = 0; ich < 4; ++ich){
+ xy[icath][ich] = xyPattern[icath][ich];
+ }
+ }
+ localBoard->SetXY(xy);
+ }
+
+ FeedCopyNeighbours();
+}
+
+//_______________________________________________________________________
+Bool_t AliMUONTriggerElectronics::ModifiedLocalResponse(Int_t loCircuit,
+ Bool_t& bendingPlaneResp,
+ Bool_t& nonBendingPlaneResp,
+ Bool_t isCoinc44,
+ Int_t removeChamber)
+{
+ //
+ /// Re-compute the local trigger response
+ /// with some modifications (i.e. setting coinc44 or after removing one chamber)
+ //
+
+ bendingPlaneResp = kFALSE;
+ nonBendingPlaneResp = kFALSE;
+
+ Bool_t isTriggered = kFALSE;
+
+ AliMUONLocalTriggerBoard* currBoard = fCrates->LocalBoard(loCircuit);
+
+ if ( ! currBoard ) return isTriggered;
+
+ AliMUONLocalTriggerBoard localBoard (*currBoard);
+
+ if (removeChamber>=0 && removeChamber<=3){
+
+ // Set the bit pattern of selected chamber to 0
+ UShort_t xy[2][4];
+ UShort_t xyu[2][4];
+ UShort_t xyd[2][4];
+
+ localBoard.GetXY(xy);
+ localBoard.GetXYU(xyu);
+ localBoard.GetXYD(xyd);
+
+ for(Int_t icath=0; icath<2; icath++){
+ xy[icath][removeChamber] = 0;
+ xyu[icath][removeChamber] = 0;
+ xyd[icath][removeChamber] = 0;
+ }
+
+ localBoard.SetXY(xy);
+ localBoard.SetXYU(xyu);
+ localBoard.SetXYD(xyd);
+ }
+
+ localBoard.ResetResponse();
+
+ localBoard.SetCoinc44((Int_t)isCoinc44);
+ localBoard.Response();
+
+ bendingPlaneResp = localBoard.IsTrigX();
+ nonBendingPlaneResp = localBoard.IsTrigY();
+ isTriggered = localBoard.Triggered();
+
+ return isTriggered;
+}
+
+
+//_______________________________________________________________________
+void AliMUONTriggerElectronics::ResponseRemovingChambers(AliMUONVTriggerStore& triggerStore)
+{
+ /// Update local board information with the trigger response after removing each chamber
+
+ AliCodeTimerAuto("", 0);
+
Reset();
+ Feed(triggerStore);
+
+ AliMUONLocalTrigger* locTrg;
+ TIter next(triggerStore.CreateLocalIterator());
+ Int_t loCircuit;
+ Bool_t planeResp[2], isTrig44;
+ Bool_t bendPlaneRespNoCh, nonBendPlaneRespNoCh, isTrigWithoutCh;
+ while ( ( locTrg = static_cast<AliMUONLocalTrigger*>( next() )) != NULL ){
+ if ( ! ( locTrg->IsTrigX() && locTrg->IsTrigY() ) ) continue;
+ loCircuit = locTrg->LoCircuit();
+ isTrig44 = ModifiedLocalResponse(loCircuit, planeResp[0], planeResp[1], kTRUE);
+ for (Int_t ich=0; ich<4; ++ich){
+ if ( ! isTrig44 ){
+ isTrigWithoutCh = ModifiedLocalResponse(loCircuit, bendPlaneRespNoCh, nonBendPlaneRespNoCh, kFALSE, ich);
+ if ( ! isTrigWithoutCh ) continue;
+ for (Int_t icath=0; icath<2; icath++){
+ if ( ! planeResp[icath] )
+ locTrg->SetNoHitInPlane(icath, ich);
+ } // loop on cathodes
+ }
+ locTrg->SetTriggerWithoutChamber(ich);
+ } // loop on chambers
+ AliDebug(1, Form("Is44 %i triggers %i pattern %i", isTrig44, locTrg->GetTriggerWithoutChamber(), locTrg->GetHitPatternFromResponse()));
+ }
}
void LoadMasks(AliMUONCalibrationData* calibData);
virtual void Feed(UShort_t pattern[2][4]);
- virtual void Feed(const AliMUONVDigitStore& digitStore);
+ virtual void Feed(const AliMUONVDigitStore& digitStore);
+ virtual void Feed(AliMUONVTriggerStore& triggerStore);
virtual void Reset();
virtual void Scan(Option_t *option);
virtual void Digits2Trigger(const AliMUONVDigitStore& digitStore,
AliMUONVTriggerStore& triggerStore);
+ virtual Bool_t ModifiedLocalResponse(Int_t loCircuit,
+ Bool_t& bendingPlaneResp,
+ Bool_t& nonBendingPlaneResp,
+ Bool_t isCoinc44 = kFALSE,
+ Int_t removeChamber = -1);
+
+ virtual void ResponseRemovingChambers(AliMUONVTriggerStore& triggerStore);
/// Return Crate array
AliMUONTriggerCrateStore* GetCrateStore() {return fCrates;}
AliMUONTriggerElectronics(const AliMUONTriggerElectronics& right);
/// Not implemented
AliMUONTriggerElectronics& operator = (const AliMUONTriggerElectronics& right);
+
+ void FeedCopyNeighbours();
/// set copy card array
void SetCopyInput();