29 #include "AliLoader.h"
61 #include "AliLoader.h"
66 #include "AliCodeTimer.h"
119 AliCodeTimerAuto(
"",0);
124 while ( ( mdig = static_cast<AliMUONVDigit*>(next()) ) )
129 Int_t schg = (Int_t)(mdig->Charge() + 0.5);
132 Int_t tchg = schg - (Int_t(schg/10))*10;
134 if (schg<=10 || tchg>0)
136 Int_t detElemId = mdig->DetElemId();
137 Int_t cathode = mdig->Cathode();
143 Int_t ix = mdig->PadX(), iy = mdig->PadY();
145 AliDebug(3,Form(
"cathode %d ix %d iy %d ",cathode,ix,iy));
161 b->
SetbitM(ibitxy,cathode,ichamber-10);
163 if ( cathode == 0 ) {
168 if ( nboardCopy > 0 ) {
170 copyBoard->
SetbitM(ibitxy,cathode,ichamber-10);
176 AliError(Form(
"Could not get local board number %d",nboard));
198 while ( ( cr = static_cast<AliMUONTriggerCrate*>(next2()) ) )
202 for (Int_t j = 1; j < boards->GetEntries()-1; j++)
204 TObject *o = boards->At(j);
214 if (j==1) {neighbour->
GetXY(cXY); currboard->
SetXYU(cXY);}
217 if (j < boards->GetEntries()-2)
224 if (j==boards->GetEntries()-3) {neighbour->
GetXY(cXY); nextboard->
SetXYD(cXY);}
240 while ( ( cr = static_cast<AliMUONTriggerCrate*>(next()) ) )
244 for (Int_t j = 1; j < boards->GetEntries(); j++)
246 TObject *o = boards->At(j);
252 board->
SetXY(pattern);
262 for (Int_t i= 0; i < 234;i++)
266 if (board) board->
Scan(
"ALL");
279 while ( ( cr = static_cast<AliMUONTriggerCrate*>(next()) ) )
283 for (Int_t j = 0; j < boards->GetEntries(); j++)
285 TObject *o = boards->At(j);
289 Bool_t cdtion = kFALSE;
291 if (op.Contains(
"LOCAL")) cdtion = o->IsA() == AliMUONLocalTriggerBoard::Class();
292 if (op.Contains(
"REGIONAL")) cdtion = o->IsA() == AliMUONRegionalTriggerBoard::Class();
293 if (op.Contains(
"GLOBAL")) cdtion = o->IsA() == AliMUONGlobalTriggerBoard::Class();
295 if (!o || !cdtion)
continue;
312 while ( ( cr = static_cast<AliMUONTriggerCrate*>(next()) ) )
316 for (Int_t j=0; j<boards->GetEntries(); j++)
334 if (!regionalConfig) {
335 AliError(
"No valid regional trigger configuration in CDB");
344 while ( ( cr = static_cast<AliMUONTriggerCrate*>(next()) ) )
354 AliError(Form(
"Crate %s not present in configuration !!!", cr->GetName()));
358 UShort_t rmask= crateConfig->
GetMask();
362 for (Int_t j = 1; j < boards->GetEntries(); j++)
371 for ( Int_t i = 0; i < localBoardMasks->
Size(); ++i )
373 UShort_t lmask =
static_cast<UShort_t
>(localBoardMasks->
ValueAsInt(i) & 0xFFFF);
383 AliError(
"No valid trigger crate configuration in CDB");
388 for (Int_t i = 0; i < 4; i++) {
399 AliCodeTimerAuto(
"",0);
406 while ( ( cr = static_cast<AliMUONTriggerCrate*>(next()) ) )
413 for (Int_t j=0; j<16; ++j) thisl[j] = 0;
415 for (Int_t j = 1; j < boards->GetEntries(); j++)
417 TObject *o = boards->At(j);
431 AliWarning(Form(
"Interface board %s in slot %d of crate %s has a non zero response",
432 board->GetName(),j,cr->GetName()));
433 AliDebug(1, Form(
"local slot %d, number %d in crate %s\n", j, board->
GetNumber(), cr->GetName()));
437 thisl[j-1] = response;
449 AliCodeTimerAuto(
"",0);
454 while ( ( cr = static_cast<AliMUONTriggerCrate*>(next()) ) )
470 AliCodeTimerAuto(
"",0);
472 UShort_t regional[16];
479 AliFatal(Form(
"Something is wrong : too many crates %d",
486 for (Int_t iSide = 0; iSide < 2; iSide++)
488 for (Int_t iReg = 0; iReg < 8; iReg++)
507 AliCodeTimerAuto(
"",0);
512 triggerStore.
Clear();
530 for (Int_t iSide = 0; iSide < 2; iSide++)
532 for (Int_t iReg = 0; iReg < 8; iReg++)
537 UInt_t regInpLpt = 0;
538 UInt_t regInpHpt = 0;
542 for (Int_t j = 1; j < boards->GetEntries(); j++)
544 TObject *o = boards->At(j);
567 localTrigger.
SetLoHpt((response & 12) >> 2);
568 localTrigger.
SetLoLpt(response & 3);
571 UInt_t hPt = (response >> 2) & 0x3;
572 UInt_t lPt = response & 0x3;
574 regInpHpt |= hPt << (30 - (j-1)*2);
575 regInpLpt |= lPt << (30 - (j-1)*2);
578 rrr.Set(6,&response);
592 triggerStore.
Add(localTrigger);
596 pRegTrig.
SetId(iReg + 8*iSide);
601 triggerStore.
Add(pRegTrig);
626 TArrayS xyPattern[2];
629 while ( ( locTrg = static_cast<AliMUONLocalTrigger*>( next() )) != NULL ){
634 for (Int_t icath = 0; icath<2; ++icath){
635 for (Int_t ich = 0; ich < 4; ++ich){
636 xy[icath][ich] = xyPattern[icath][ich];
639 localBoard->
SetXY(xy);
647 Bool_t& bendingPlaneResp,
648 Bool_t& nonBendingPlaneResp,
657 bendingPlaneResp = kFALSE;
658 nonBendingPlaneResp = kFALSE;
660 Bool_t isTriggered = kFALSE;
664 if ( ! currBoard )
return isTriggered;
668 if (removeChamber>=0 && removeChamber<=3){
675 localBoard.
GetXY(xy);
679 for(Int_t icath=0; icath<2; icath++){
680 xy[icath][removeChamber] = 0;
681 xyu[icath][removeChamber] = 0;
682 xyd[icath][removeChamber] = 0;
685 localBoard.
SetXY(xy);
695 bendingPlaneResp = localBoard.
IsTrigX();
696 nonBendingPlaneResp = localBoard.
IsTrigY();
708 AliCodeTimerAuto(
"", 0);
716 Bool_t planeResp[2], isTrig44;
717 Bool_t bendPlaneRespNoCh, nonBendPlaneRespNoCh, isTrigWithoutCh;
718 while ( ( locTrg = static_cast<AliMUONLocalTrigger*>( next() )) != NULL ){
722 for (Int_t ich=0; ich<4; ++ich){
724 isTrigWithoutCh =
ModifiedLocalResponse(loCircuit, bendPlaneRespNoCh, nonBendPlaneRespNoCh, kFALSE, ich);
725 if ( ! isTrigWithoutCh )
continue;
726 for (Int_t icath=0; icath<2; icath++){
727 if ( ! planeResp[icath] )
void GetYPattern(TArrayS &array) const
return Y pattern array
virtual void SetbitM(Int_t strip, Int_t cathode, Int_t chamber)
Int_t GetNofLocations() const
void SetFromGlobalInput(const UInt_t *globalInput)
void ReadFromFile(AliMUONCalibrationData *calibData)
The class defines the configuration of global crate.
const AliMpVSegmentation * GetMpSegmentation(Int_t detElemId, AliMp::CathodType cath, Bool_t warn=true) const
The class defines the configuration of trigger crate.
virtual TIterator * CreateLocalIterator() const =0
Create iterator on local trigger.
void SetLocalOutput(UInt_t local, Int_t n)
Set local output Lpt & Hpt.
void SetFromGlobalResponse(UShort_t globalResponse)
virtual void Scan(Option_t *option="") const
virtual method for derivated classes
virtual void SetXY(UShort_t XY[2][4])
Set XY.
AliMUONRegionalTriggerConfig * RegionalTriggerConfig() const
Get the config for regional trigger.
void SetCoinc44(Int_t coinc44=0)
Set Coinc 44 (0/1 = coinc34/coinc44)
virtual void Reset()=0
virtual method for derivated classes
virtual Bool_t IsNotified() const
Is notified (copy boards are not)
UInt_t GetGlobalMask(Int_t index) const
Get mask for the global input.
AliMpLocalBoard * GetLocalBoard(Int_t localBoardId, Bool_t warn=true) const
Interface for a digit container.
void SetY3Pattern(UShort_t pat)
Set Y strip pattern for chamber 21.
void SetLoTrigY(Int_t loTrigY)
Set Trig Y.
static AliMpSegmentation * Instance(Bool_t warn=true)
Bool_t IsTrigY() const
Trigger response Y strips.
void SetLoStripX(Int_t loStrX)
Set X strip in MT11.
virtual Int_t GetStripX11() const
Return MT1 X position of the valid road.
virtual Int_t Size() const =0
The number of channels handled by this object.
void SetX1Pattern(UShort_t pat)
Set X strip pattern for chamber 11.
virtual void LocalResponse()
void GetXPattern(TArrayS &array) const
return X pattern array
virtual void GetXY(UShort_t XY[2][4]) const
Return XY.
virtual void SetGlobal(const AliMUONGlobalTrigger &globalTrigger)=0
Set global trigger.
static Bool_t LoadDDLStore(Bool_t warn=false)
Int_t NumberOfCrates() const
virtual Int_t Triggered() const
Return info if Board has triggered.
AliMUONVCalibParam * LocalTriggerBoardMasks(Int_t localBoardNumber) const
Get the mask for a given local trigger board.
AliMUONTriggerCrateStore * fCrates
void SetOutput(Char_t o)
Set regional output (single muon:2, unlike sign:1, like sign:1)
Class that manages the properties of the local board.
void Mask(UShort_t mask)
set local boards enable
AliMUONLocalTriggerBoard * LocalBoard(Int_t boardNumber) const
Regional trigger - real HW algorithm is implemented.
virtual AliMpPad PadByIndices(Int_t ix, Int_t iy, Bool_t warning=true) const =0
Find pad by indices.
virtual void SetLocalResponse(UShort_t val[16])
Set Local trigger inputs.
TIterator * CreateCrateIterator() const
A container for AliMUONTriggerCrate objects.
Base class of a trigger information store.
virtual void RegionalResponse()
virtual UShort_t GetSwitch(Int_t i) const
Return i-th Switch value.
virtual void SetXYD(UShort_t V[2][4])
Set XYD.
Manager class for muon trigger electronics.
virtual Int_t GetStripY11() const
Return MT1 Y position of the valid road.
virtual void ResetResponse()
virtual void Response()
virtual method for derivated classes
void SetTriggerWithoutChamber(Int_t ich)
The board would provide a trigger even after removing chamber ich [0,3].
virtual Int_t GetTrigY() const
Return Trigger in Y.
virtual void Response()
virtual method for derivated classes
Container of calibration values for a given number of channels.
Reconstructed regional Trigger object.
static AliMpDDLStore * Instance(Bool_t warn=true)
static Int_t GetChamberId(Int_t detElemId, Bool_t warn=true)
void SetY4Pattern(UShort_t pat)
Set Y strip pattern for chamber 22.
AliMUONGlobalTriggerBoard * fGlobalTriggerBoard
Global trigger board.
void SetId(Int_t d)
Set regional id.
void SetLoLpt(Int_t loLpt)
Set Low pt.
void SetNoHitInPlane(Int_t icath, Int_t ich)
Trigger algorithm did NOT find hit in the specified chamber and cathode.
Trigger board base class.
virtual void ResponseRemovingChambers(AliMUONVTriggerStore &triggerStore)
Int_t GetInputXto() const
Get Id to where the X input are copied.
void SetLoStripY(Int_t loStrY)
Set Y strip in MT11.
Reconstructed Local Trigger object.
(1) reset the LSB for special configuration of board RC2L5B4 & RC2L6B1
virtual void GlobalResponse()
virtual void Mask(Int_t index, UShort_t value)
Implementation of local trigger board objects.
virtual Int_t GetSdev() const
Return Sign of Deviation.
virtual TIterator * CreateTriggerIterator() const =0
Create an iterator to loop over trigger digits only.
AliMUONTriggerCrateConfig * FindTriggerCrate(TString crateName, Bool_t warn=true) const
AliMUONGlobalCrateConfig * GlobalTriggerCrateConfig() const
Get the configuration for the global trigger board.
virtual void GetXYD(UShort_t V[2][4]) const
Return XYD.
virtual UShort_t GetResponse() const
Return response.
virtual void Factory(AliMUONCalibrationData *calibData)
void SetX3Pattern(UShort_t pat)
Set X strip pattern for chamber 21.
UShort_t GetHitPatternFromResponse() const
Hit pattern from the re-calculated trigger response after removing chambers one-by-one.
AliMp::CathodType GetCathodType(Int_t cathodNumber)
Convert integer number in enum;.
virtual Int_t GetNumber() const
Return Board number.
AliMUONRegionalTriggerConfig * regionalConfig
Int_t GetLocalBoardId(Int_t i) const
void SetX2Pattern(UShort_t pat)
Set X strip pattern for chamber 12.
virtual void Response()
virtual method for derivated classes
virtual Int_t ValueAsInt(Int_t i, Int_t j=0) const =0
virtual Bool_t IsTrigX() const
AliMUONCalibrationData * calibData
void FeedCopyNeighbours()
void SetY2Pattern(UShort_t pat)
Set Y strip pattern for chamber 12.
virtual void SetXYU(UShort_t V[2][4])
Set XYU.
Single entry point to access MUON calibration data.
virtual void Feed(UShort_t pattern[2][4])
void SetLoSdev(Int_t loSdev)
Set Sign of Deviation.
The abstract base class for the segmentation.
Bool_t IsTrigX() const
Trigger response X strips.
virtual Bool_t ModifiedLocalResponse(Int_t loCircuit, Bool_t &bendingPlaneResp, Bool_t &nonBendingPlaneResp, Bool_t isCoinc44=kFALSE, Int_t removeChamber=-1)
UChar_t GetTriggerWithoutChamber() const
Triggers from the re-calculated trigger response after removing chambers one-by-one.
Class which encapsuate all information about a pad.
virtual Bool_t Add(TObject *object)
Add an object, if of the right type.
virtual TObjArray * Boards()
Return pointer to board objects.
void SetLoDev(Int_t loDev)
Set Deviation.
virtual void Clear(Option_t *opt="")=0
Clear ourselves (i.e. Reset)
void SetLoHpt(Int_t loHpt)
Set High pt.
virtual void SetRegionalResponse(UShort_t resp[16])
Set regional board responses.
virtual Int_t GetDev() const
Return Deviation.
virtual void Scan(const Option_t *option)
virtual void Digits2Trigger(const AliMUONVDigitStore &digitStore, AliMUONVTriggerStore &triggerStore)
AliMUONTriggerCrate * Crate(const char *crateName) const
void SetX4Pattern(UShort_t pat)
Set X strip pattern for chamber 22.
UInt_t * GetGlobalInput()
Global input 4 words (32bits) from regional responses.
AliMUONTriggerCrateStore * fCrates
Crate array.
Int_t GetLocalBoardChannel(Int_t i) const
void SetY1Pattern(UShort_t pat)
Set Y strip pattern for chamber 11.
virtual ~AliMUONTriggerElectronics()
Int_t LoCircuit() const
Return Circuit number.
The class defines the properties of regional trigger crate.
void SetLoCircuit(Int_t loCir)
Set Circuit number.
void LoadMasks(AliMUONCalibrationData *calibData)
AliMUONGlobalTriggerBoard * fGlobalTriggerBoard
virtual void GetXYU(UShort_t V[2][4]) const
Return XYU.
AliMUONGlobalCrateConfig * globalConfig
UShort_t GetMask() const
Return mask.
virtual Bool_t IsTrigY() const
void Mask(Int_t index, UInt_t mask)
Set mask for global input (from regional boards)