Line data Source code
1 : /**************************************************************************
2 : * Copyright(c) 1998-2013, 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 : #include "AliEMCALTriggerChannelContainer.h"
16 :
17 : /// \cond CLASSIMP
18 22 : ClassImp(AliEMCALTriggerChannelContainer)
19 22 : ClassImp(AliEMCALTriggerChannelContainer::AliEMCALTriggerChannelPosition)
20 : /// \endcond
21 :
22 : void AliEMCALTriggerChannelContainer::AddChannel(int col, int row){
23 0 : if(HasChannel(col, row)) return;
24 0 : fChannels.Add(new AliEMCALTriggerChannelPosition(col, row));
25 0 : }
26 :
27 : Bool_t AliEMCALTriggerChannelContainer::HasChannel(int col, int row){
28 0 : AliEMCALTriggerChannelPosition refChannel;
29 0 : if(fChannels.FindObject(&refChannel)) return true;
30 0 : return false;
31 0 : }
32 :
33 :
34 : Bool_t AliEMCALTriggerChannelContainer::AliEMCALTriggerChannelPosition::IsEqual(const TObject *ref) const {
35 0 : const AliEMCALTriggerChannelPosition *refpos = dynamic_cast<const AliEMCALTriggerChannelPosition *>(ref);
36 0 : if(!refpos) return false;
37 0 : return fCol == refpos->fCol && fRow == refpos->fRow;
38 0 : }
39 :
40 : Int_t AliEMCALTriggerChannelContainer::AliEMCALTriggerChannelPosition::Compare(const TObject *ref) const {
41 0 : const AliEMCALTriggerChannelPosition *refpos = dynamic_cast<const AliEMCALTriggerChannelPosition *>(ref);
42 0 : if(!refpos) return 1;
43 0 : if(fCol == refpos->fCol){
44 0 : if(fRow == refpos->fRow) return 0;
45 0 : else if(fRow < refpos->fRow) return -1;
46 0 : else return 1;
47 : }
48 0 : else if(fCol < refpos->fCol) return -1;
49 0 : else return 1;
50 0 : }
|