Replacing some non-standard operators (not,and,or) with the standard ones. Code clean-up
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 10 Feb 2006 14:54:27 +0000 (14:54 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 10 Feb 2006 14:54:27 +0000 (14:54 +0000)
12 files changed:
HLT/MUON/src/AliRoot/ADCStreamSource.cxx
HLT/MUON/src/AliRoot/ClusterSource.cxx
HLT/MUON/src/AliRoot/MicrodHLT.cxx
HLT/MUON/src/AliRoot/Region.cxx
HLT/MUON/src/AliRoot/Track.cxx
HLT/MUON/src/AliRoot/TrackSink.cxx
HLT/MUON/src/AliRoot/TriggerRecord.cxx
HLT/MUON/src/AliRoot/TriggerSource.cxx
HLT/MUON/src/Debug/print.cxx
HLT/MUON/src/RegionOfInterest.cxx
HLT/MUON/src/RegionOfInterest.hpp
HLT/MUON/src/Tracking/MansoTracker.cxx

index d6824bab397b6d1fe8d475a6c5b96c6deefe14a3..da970947149ee1681209780c546f75ae7d4ad051 100644 (file)
@@ -125,7 +125,7 @@ Int_t ADCStreamSource::NumberOfStreams() const
 
 Bool_t ADCStreamSource::GetStream(Int_t index) const
 {
-       if ( 0 <= index and index < NumberOfStreams() )
+       if ( 0 <= index && index < NumberOfStreams() )
        {
                fCurrentStream = index;
                return kTRUE;
@@ -162,7 +162,7 @@ Bool_t ADCStreamSource::FirstStream() const
 
 Bool_t ADCStreamSource::NextStream() const
 {
-       if ( 0 <= fCurrentStream and fCurrentStream < NumberOfStreams() - 1 )
+       if ( 0 <= fCurrentStream && fCurrentStream < NumberOfStreams() - 1 )
        {
                fCurrentStream++;
                return kTRUE;
index 7821695ef386e265afbf216f5552ae6340c3fd2e..ec545cf220da80fa16acc4e1a541338f14711561 100644 (file)
@@ -112,16 +112,16 @@ void ClusterSource::FillFrom(
                if ( fCurrentEvent == NULL )
                {
                        Bool_t found = GetEvent(event);
-                       if (not found) AddEvent(event);
+                       if ( ! found) AddEvent(event);
                }
                else
                {
                        if (fCurrentEvent->fEventNumber != event)
                        {
                                Bool_t found = GetEvent(event);
-                               if (not found) AddEvent(event);
-                       };
-               };
+                               if ( ! found) AddEvent(event);
+                       }
+               }
                
                if ( fCurrentBlock != 0)
                {
@@ -137,7 +137,7 @@ void ClusterSource::FillFrom(
                        {
                                // If the newblock flag is set then force a new block.
                                if (newblock) AddBlock(chamber);
-                       };
+                       }
                }
                else
                        AddBlock(chamber);  // No block selected so we need to create a new block.
@@ -204,7 +204,7 @@ Bool_t ClusterSource::GetFirstEvent() const
 
 Bool_t ClusterSource::MoreEvents() const
 {
-       return 0 <= fEventIndex and fEventIndex < fEventList.GetEntriesFast();
+       return 0 <= fEventIndex && fEventIndex < fEventList.GetEntriesFast();
 }
 
 
@@ -224,8 +224,8 @@ Bool_t ClusterSource::GetNextEvent() const
        {
                ResetAllPointers();
                return kFALSE;
-       };
-};
+       }
+}
 
 
 Int_t ClusterSource::CurrentEvent() const
@@ -234,7 +234,7 @@ Int_t ClusterSource::CurrentEvent() const
                return fCurrentEvent->fEventNumber;
        else
                return -1;
-};
+}
 
 
 Int_t ClusterSource::NumberOfBlocks() const
@@ -258,7 +258,7 @@ Bool_t ClusterSource::GetBlock(Int_t index) const
        Int_t numberofblocks = NumberOfBlocks();
        if (numberofblocks < 0) return kFALSE;
 
-       if ( 0 <= index and index < numberofblocks )
+       if ( 0 <= index && index < numberofblocks )
        {
                fBlockIndex = index;
                fCurrentBlock = (BlockData*) fCurrentEvent->fBlocks[index];
@@ -307,7 +307,7 @@ Bool_t ClusterSource::GetFirstBlock() const
 
 Bool_t ClusterSource::MoreBlocks() const
 {
-       return 0 <= fBlockIndex and fBlockIndex < NumberOfBlocks();
+       return 0 <= fBlockIndex && fBlockIndex < NumberOfBlocks();
 }
 
 
@@ -367,7 +367,7 @@ const Point* ClusterSource::GetCluster(Int_t index) const
        Int_t numberofclusters = NumberOfClusters();
        if (numberofclusters < 0) return NULL;
        
-       if ( 0 <= index and index < numberofclusters )
+       if ( 0 <= index && index < numberofclusters )
        {
                fClusterIndex = index;
                fCurrentCluster = (Point*) fCurrentBlock->fClusters[index];
@@ -414,8 +414,8 @@ const Point* ClusterSource::GetFirstCluster() const
 
 Bool_t ClusterSource::MoreClusters() const
 {
-       return 0 <= fClusterIndex and fClusterIndex < NumberOfClusters();
-};
+       return 0 <= fClusterIndex && fClusterIndex < NumberOfClusters();
+}
 
 
 const Point* ClusterSource::GetNextCluster() const
@@ -436,8 +436,8 @@ const Point* ClusterSource::GetNextCluster() const
        {
                ResetClusterPointers();
                return NULL;
-       };
-};
+       }
+}
 
 
 Bool_t ClusterSource::FetchCluster(Float_t& x, Float_t& y) const
@@ -483,7 +483,7 @@ void ClusterSource::AddBlock(Int_t chamber)
        {
                Error("AddBlock", "No event selected.");
                return;
-       };
+       }
        
        fBlockIndex = fCurrentEvent->fBlocks.GetEntriesFast();
        new ( fCurrentEvent->fBlocks[fBlockIndex] ) BlockData(chamber);
@@ -506,7 +506,7 @@ void ClusterSource::AddPoint(Float_t x, Float_t y)
        {
                Error("AddPoint", "No block selected.");
                return;
-       };
+       }
        
        fClusterIndex = fCurrentBlock->fClusters.GetEntriesFast();
        new ( fCurrentBlock->fClusters[fClusterIndex] ) Point(x, y);
@@ -526,7 +526,7 @@ Bool_t ClusterSource::FileAndFolderOk(AliMUONDataInterface* data)
                fFilename = data->CurrentFile();
                fFoldername = data->CurrentFolder();
                return kTRUE;
-       };
+       }
 
        if ( fFilename != data->CurrentFile() )
        {
@@ -535,7 +535,7 @@ Bool_t ClusterSource::FileAndFolderOk(AliMUONDataInterface* data)
                        fFilename.Data(), data->CurrentFile().Data()
                );
                return kFALSE;
-       };
+       }
        
        if ( fFoldername != data->CurrentFolder() )
        {
@@ -571,7 +571,7 @@ void ClusterSource::AddChamberFrom(AliMUONDataInterface* data, Int_t chamber)
        UInt_t currentblocksize = 0;
 #ifndef __alpha
 #ifndef __sun
-       Float_t x = NAN, y = NAN;
+       Float_t x = nanf(""), y = nanf("");
 #else
        Float_t x = 0, y = 0;
 #endif
@@ -595,8 +595,8 @@ void ClusterSource::AddChamberFrom(AliMUONDataInterface* data, Int_t chamber)
                                        x = h->X();
                                        y = h->Y();
                                        break;
-                               };
-                       };
+                               }
+                       }
 
                        // Continue to the next track if we could not find a hit
                        // on the current track and chamber.
@@ -606,7 +606,7 @@ void ClusterSource::AddChamberFrom(AliMUONDataInterface* data, Int_t chamber)
                                        chamber, track, data->CurrentEvent()
                                );
                                continue;
-                       };
+                       }
 
                        if (InFillRegion(x, y))
                        {
@@ -617,9 +617,9 @@ void ClusterSource::AddChamberFrom(AliMUONDataInterface* data, Int_t chamber)
                                {
                                        AddBlock(chamber);
                                        currentblocksize = 0;
-                               };
-                       };
-               };
+                               }
+                       }
+               }
                break;
 
        case FromRawClusters:
@@ -638,9 +638,9 @@ void ClusterSource::AddChamberFrom(AliMUONDataInterface* data, Int_t chamber)
                                {
                                        AddBlock(chamber);
                                        currentblocksize = 0;
-                               };
-                       };
-               };
+                               }
+                       }
+               }
                break;
 
        default:
@@ -658,7 +658,7 @@ void ClusterSource::AddClusterFrom(
        DebugMsg(1, "Entering AddClusterFrom");
 #ifndef __alpha
 #ifndef __sun  
-       Float_t x = NAN, y = NAN;
+       Float_t x = nanf(""), y = nanf("");
 #else
        Float_t x = 0, y = 0;
 #endif
@@ -681,8 +681,8 @@ void ClusterSource::AddClusterFrom(
                                x = h->X();
                                y = h->Y();
                                break;
-                       };
-               };
+                       }
+               }
 
                if (i >= data->NumberOfHits(cluster))
                {
@@ -692,7 +692,7 @@ void ClusterSource::AddClusterFrom(
                        );
                        DebugMsg(1, "Leaving AddClusterFrom");
                        return;
-               };
+               }
                }
                break;
 
@@ -707,12 +707,12 @@ void ClusterSource::AddClusterFrom(
        default:
                Error("AddClusterFrom", "fDataToUse is not set to a valid value.");
                return;
-       };
+       }
        
        AddPoint(x, y);
        
        DebugMsg(1, "Leaving AddClusterFrom");
-};
+}
 
 
 Bool_t ClusterSource::InFillRegion(Float_t x, Float_t /*y*/)
@@ -726,8 +726,8 @@ Bool_t ClusterSource::InFillRegion(Float_t x, Float_t /*y*/)
        default:
                Error("InFillRegion", "fAreaToUse is not set to a valid value.");
                return kFALSE;
-       };
-};
+       }
+}
 
 
 void ClusterSource::ResetAllPointers() const
@@ -741,7 +741,7 @@ void ClusterSource::ResetAllPointers() const
        DebugMsg(2, "\tfEventIndex = " << fEventIndex << " , fBlockIndex = " << fBlockIndex
                << " , fClusterIndex = " << fClusterIndex
        );
-};
+}
 
 
 void ClusterSource::ResetBlockPointers() const
index 013242ceb9c11bae58d44fcacb18e036654ec7da..21ee06e8c1100b5921d50c9496cc0e7b4ac288fb 100644 (file)
@@ -33,7 +33,7 @@ class MicroFramework : public Tracking::TrackerCallback
 {
 public:
 
-       virtual ~MicroFramework() {};
+       virtual ~MicroFramework() {}
 
        virtual void RequestClusters(
                        Tracking::Tracker* tracker, 
@@ -41,20 +41,20 @@ public:
                        ChamberID chamber, const void* tag
                )
        {
-               Assert( 0 <= chamber and chamber <= 10 );
+               Assert( 0 <= chamber && chamber <= 10 );
                DebugMsg(2, "RequestClusters: tag = " << tag);
                register void* ctag = const_cast<void*>(tag);  // We never modify tag so this is OK.
                if (clusters[chamber] != NULL)
                        tracker->ReturnClusters(ctag, clusters[chamber], clustercount[chamber]);
                tracker->EndOfClusters(ctag);
-       };
+       }
 
        
   virtual void EndOfClusterRequests(Tracking::Tracker* /*tracker*/)
        {
                DebugMsg(2, "EndOfClusterRequests");
                // We can ignore this. Nothing special to do here.
-       };
+       }
 
        
        virtual void FoundTrack(Tracking::Tracker* tracker)
@@ -69,7 +69,7 @@ public:
                newtrack.triggerid = currenttriggernumber;
 
                *trackoutput->AddTrack() = Convert(newtrack);
-       };
+       }
        
        
        virtual void NoTrackFound(Tracking::Tracker* /*tracker*/)
@@ -77,7 +77,7 @@ public:
                DebugMsg(2, "NoTrackFound");
                // Again nothing special to do here. The allocated memory is released
                // in the Run method.
-       };
+       }
 
 
        void Run(
@@ -87,13 +87,13 @@ public:
                        Tracking::Tracker* tracker
                )
        {
-               if (not triggersource->GetFirstEvent()) return;
+               if ( ! triggersource->GetFirstEvent()) return;
                while (triggersource->MoreEvents())
                {
                        Run(triggersource, clustersource, tracksink, tracker, triggersource->CurrentEvent());
                        triggersource->GetNextEvent();
-               };
-       };
+               }
+       }
 
 
        void Run(
@@ -119,7 +119,7 @@ public:
                (
                        FreeClusterBlocks();
                );
-       };
+       }
 
 
 private:
@@ -133,19 +133,19 @@ private:
                while (cs->MoreBlocks())
                {
                        Int chamber = cs->Chamber();
-                       if (0 <= chamber and chamber < 10)
+                       if (0 <= chamber && chamber < 10)
                        {
                                clustercount[chamber] += cs->NumberOfClusters();
-                       };
+                       }
                        cs->GetNextBlock();
-               };
-       };
+               }
+       }
        
 
        void CreateClusterBlocks(const AliMUONHLT::ClusterSource* cs, Int eventnumber)
        {
                // Must select the proper event before counting or filling the arrays.
-               if ( not cs->GetEvent(eventnumber) ) return;
+               if ( ! cs->GetEvent(eventnumber) ) return;
                
                CountClusterPoints(cs);
                
@@ -160,14 +160,14 @@ private:
                                clusters[i] = new ClusterPoint[ clustercount[i] ];
                        else
                                clusters[i] = NULL;
-               };
+               }
 
                // Copy all the cluster data into arrays.
                cs->GetFirstBlock();
                while (cs->MoreBlocks())
                {
                        Int chamber = cs->Chamber();
-                       if (0 <= chamber and chamber < 10)
+                       if (0 <= chamber && chamber < 10)
                        {
                                cs->GetFirstCluster();
                                while (cs->MoreClusters())
@@ -176,11 +176,11 @@ private:
                                        cs->FetchCluster(newpoint.x, newpoint.y);
                                        clusters[chamber][currentcount[chamber]++] = newpoint;
                                        cs->GetNextCluster();
-                               };
-                       };
+                               }
+                       }
                        cs->GetNextBlock();
-               };
-       };
+               }
+       }
 
 
        void FreeClusterBlocks()
@@ -189,8 +189,8 @@ private:
                {
                        if (clusters[i] != NULL)
                                delete [] clusters[i];
-               };
-       };
+               }
+       }
        
        
        void ProcessTriggers(const AliMUONHLT::TriggerSource* ts, Tracking::Tracker* tracker)
@@ -216,10 +216,10 @@ private:
                                tracker->Reset();
                                
                                ts->GetNextTrigger();
-                       };
+                       }
                        ts->GetNextBlock();
-               };
-       };
+               }
+       }
        
        
        UInt clustercount[10];
@@ -246,22 +246,22 @@ TString Version()
 {
        TString str = dHLT::VersionString();
        return str;
-};
+}
 
 UInt_t MajorVersion()
 {
        return dHLT::MajorVersion();
-};
+}
 
 UInt_t MinorVersion()
 {
        return dHLT::MinorVersion();
-};
+}
 
 UInt_t BuildNumber()
 {
        return dHLT::BuildNumber();
-};
+}
 
 
 MicrodHLT::MicrodHLT() : TObject()
@@ -271,24 +271,24 @@ MicrodHLT::MicrodHLT() : TObject()
        fTrackSink = NULL;
        fClusterFinder = NULL;
        fTracker = NULL;
-};
+}
 
 
 MicrodHLT::~MicrodHLT()
 {
        // Nothing to do here.
-};
+}
 
 
 void MicrodHLT::SetTriggerSource(const TriggerSource* source)
 {
        fTriggerSource = const_cast<TriggerSource*>( source );
-};
+}
 
 void MicrodHLT::SetClusterSource(const ClusterSource* source)
 {
        fClusterSource = const_cast<ClusterSource*>( source );
-};
+}
 
 
 void MicrodHLT::Run()
@@ -303,23 +303,23 @@ void MicrodHLT::Run()
        {
                Error("Run", "The trigger source was not set.");
                return;
-       };
+       }
        if (fClusterSource == NULL)
        {
                Error("Run", "The cluster source was not set.");
                return;
-       };
+       }
        if (fTrackSink == NULL)
        {
                Error("Run", "The track output sink was not set.");
                return;
-       };
+       }
        
-       if (fTriggerSource->FileName() != fClusterSource->FileName() or
+       if (fTriggerSource->FileName() != fClusterSource->FileName() ||
            fTriggerSource->FolderName() != fClusterSource->FolderName())
        {
                Warning("Run", "The file and folder names of the trigger source and cluster source do not correspond.");
-       };
+       }
 
        dHLT::Clustering::ClusterFinder* clusterfinder = NULL;
        dHLT::Tracking::Tracker* tracker = NULL;
@@ -337,7 +337,7 @@ void MicrodHLT::Run()
                                = new dHLT::AliRoot::ClusterFinderProxy(fClusterFinder);
                        fClusterFinder->SetCallback(clusterfinderproxy);
                        clusterfinder = clusterfinderproxy;
-               };
+               }
 
                // Assign the dHLT tracker object. If the fTracker field was not set just
                // use the default MansoTracker implementation.
@@ -350,7 +350,7 @@ void MicrodHLT::Run()
                        dHLT::AliRoot::TrackerProxy* trackerproxy = new dHLT::AliRoot::TrackerProxy(fTracker);
                        fTracker->SetCallback(trackerproxy);
                        tracker = trackerproxy;
-               };
+               }
 
                dHLT::MicroFramework framework;
                framework.Run(fTriggerSource, fClusterSource, fTrackSink, tracker);
@@ -360,14 +360,14 @@ void MicrodHLT::Run()
                if (tracker != NULL) delete tracker;
                if (clusterfinder != NULL) delete clusterfinder;
        );
-};
+}
 
 
 #ifdef DEBUG
 void MicrodHLT::DebugLevel(Int_t value)
 {
        dHLT::DebugLevel = value;
-};
+}
 #else // DEBUG
 void MicrodHLT::DebugLevel(Int_t /*value*/) {}
 #endif // DEBUG
@@ -380,7 +380,7 @@ Int_t MicrodHLT::DebugLevel()
 #else // DEBUG
        return -1;
 #endif // DEBUG
-};
+}
 
 
 } // AliMUONHLT
index a3229b9937c01ddc0c6b0361f608cad1dc0dfe72..2b202f15e8052b3ee05c48de94b7f23974fd384d 100644 (file)
@@ -83,7 +83,11 @@ void Region::Top(Float_t value)
 
 Bool_t Region::Contains(const Point& p) const
 {
-       return fLeft <= p.fX and p.fX <= fRight and fBottom <= p.fY and p.fY <= fTop;
+       return 
+         fLeft <= p.fX 
+         && p.fX <= fRight 
+         && fBottom <= p.fY 
+         && p.fY <= fTop;
 }
 
 
index d8b3827fa12f89ed7c94ea47421a95cf12d667a9..396bdd088472ea9bc250ed83af33e9013394eb42 100644 (file)
@@ -26,7 +26,7 @@ Track::Track(
                const Point hits[10], const Region regions[10]
        ) : TObject()
 {
-       if (sign < -1 or +1 < sign)
+       if (sign < -1 || +1 < sign)
        {
                Init();
                Error("Track", "The particle sign was not one of -1, 0 or +1. Got %d", sign);
@@ -68,7 +68,7 @@ void Track::Init()
 
 void Track::ParticleSign(Int_t value)
 {
-       if (-1 <= value and value <= +1)
+       if (-1 <= value && value <= +1)
                fParticleSign = value;
        else
                Error("ParticleSign",
@@ -194,7 +194,7 @@ Bool_t Track::HitsInRegions() const
 {
        for (Int_t i = 0; i < 10; i++)
        {
-               if ( not fRegionOfInterest[i].Contains(fHit[i]) )
+               if ( ! fRegionOfInterest[i].Contains(fHit[i]) )
                        return kFALSE;
        }
        return kTRUE;
index 1f9510fdac338f2e0ae7dc0ecdd04a606094ef3d..9436280433830378f42a15f10f6bb4d05b58167f 100644 (file)
@@ -219,7 +219,7 @@ Bool_t TrackSink::GetFirstEvent() const
 
 Bool_t TrackSink::MoreEvents() const
 {
-       return 0 <= fEventIndex and fEventIndex < fEventList.GetEntriesFast();
+       return 0 <= fEventIndex && fEventIndex < fEventList.GetEntriesFast();
 }
 
 
@@ -273,7 +273,7 @@ Bool_t TrackSink::GetBlock(Int_t index) const
        Int_t numberofblocks = NumberOfBlocks();
        if (numberofblocks < 0) return kFALSE;
 
-       if ( 0 <= index and index < numberofblocks )
+       if ( 0 <= index && index < numberofblocks )
        {
                fBlockIndex = index;
                fCurrentBlock = (TClonesArray*) fCurrentEvent->fBlocks[index];
@@ -322,7 +322,7 @@ Bool_t TrackSink::GetFirstBlock() const
 
 Bool_t TrackSink::MoreBlocks() const
 {
-       return 0 <= fBlockIndex and fBlockIndex < NumberOfBlocks();
+       return 0 <= fBlockIndex && fBlockIndex < NumberOfBlocks();
 }
 
 
@@ -370,7 +370,7 @@ const Track* TrackSink::GetTrack(Int_t index) const
        Int_t numberoftracks = NumberOfTracks();
        if (numberoftracks < 0) return NULL;
        
-       if ( 0 <= index and index < numberoftracks )
+       if ( 0 <= index && index < numberoftracks )
        {
                fTrackIndex = index;
                fCurrentTrack = (Track*) fCurrentBlock->At(index);
@@ -417,7 +417,7 @@ const Track* TrackSink::GetFirstTrack() const
 
 Bool_t TrackSink::MoreTracks() const
 {
-       return 0 <= fTrackIndex and fTrackIndex < NumberOfTracks();
+       return 0 <= fTrackIndex && fTrackIndex < NumberOfTracks();
 }
 
 
index 548f30229b8b4df3106d90219bc320347dde203a..d0a2ddd206fd1e2312b488aaa2f5c760dad478bf 100644 (file)
@@ -32,7 +32,7 @@ TriggerRecord::TriggerRecord(
                        triggernumber
                );
        }
-       else if (sign < -1 or +1 < sign)
+       else if (sign < -1 || +1 < sign)
        {
                Init();
                Error("TriggerRecord",
@@ -81,7 +81,7 @@ void TriggerRecord::TriggerNumber(Int_t value)
 
 void TriggerRecord::ParticleSign(Int_t value)
 {
-       if (-1 <= value and value <= +1)
+       if (-1 <= value && value <= +1)
                fParticleSign = value;
        else
                Error("ParticleSign",
index 9ed2e753797a4016060c5307cd730a69a3630ec7..8cb50d20beec92fce5172ae2fe2e93b1daf0318e 100644 (file)
@@ -72,7 +72,7 @@ void TriggerSource::FillFrom(AliMUONDataInterface* data)
        if (FileAndFolderOk(data))
        {
                AliMUON* module = NULL;
-               if ( not FetchAliMUON(module) ) return;
+               if ( ! FetchAliMUON(module) ) return;
                
                for (Int_t i = 0; i < data->NumberOfEvents(); i++)
                {
@@ -91,7 +91,7 @@ void TriggerSource::FillFrom(AliMUONDataInterface* data, Int_t event)
        if (FileAndFolderOk(data))
        {
                AliMUON* module = NULL;
-               if ( not FetchAliMUON(module) ) return;
+               if ( ! FetchAliMUON(module) ) return;
                AddEventFrom(data, module, event);
                FinishedWithAliMUON();
        }
@@ -109,7 +109,7 @@ void TriggerSource::FillFrom(
        {
                data->GetEvent(event);
                AliMUON* module = NULL;
-               if ( not FetchAliMUON(module) ) return;
+               if ( ! FetchAliMUON(module) ) return;
 
                // Check if the current event corresponds to the event number we are
                // attempting to add to. If they do not or no event is selected then
@@ -117,16 +117,16 @@ void TriggerSource::FillFrom(
                if ( fCurrentEvent == NULL )
                {
                        Bool_t found = GetEvent(event);
-                       if (not found) AddEvent(event);
+                       if ( ! found) AddEvent(event);
                }
                else
                {
                        if (fCurrentEvent->fEventNumber != event)
                        {
                                Bool_t found = GetEvent(event);
-                               if (not found) AddEvent(event);
-                       };
-               };
+                               if ( ! found) AddEvent(event);
+                       }
+               }
                
                if ( fCurrentBlock != NULL )
                {
@@ -169,8 +169,8 @@ Bool_t TriggerSource::GetEvent(Int_t eventnumber) const
                                << " , fTriggerIndex = " << fTriggerIndex
                        );
                        return kTRUE;
-               };
-       };
+               }
+       }
        return kFALSE;
 }
 
@@ -200,7 +200,7 @@ Bool_t TriggerSource::GetFirstEvent() const
 
 Bool_t TriggerSource::MoreEvents() const
 {
-       return 0 <= fEventIndex and fEventIndex < fEventList.GetEntriesFast();
+       return 0 <= fEventIndex && fEventIndex < fEventList.GetEntriesFast();
 }
 
 
@@ -254,7 +254,7 @@ Bool_t TriggerSource::GetBlock(Int_t index) const
        Int_t numberofblocks = NumberOfBlocks();
        if (numberofblocks < 0) return kFALSE;
 
-       if ( 0 <= index and index < numberofblocks )
+       if ( 0 <= index && index < numberofblocks )
        {
                fBlockIndex = index;
                fCurrentBlock = (TClonesArray*) fCurrentEvent->fBlocks[index];
@@ -303,7 +303,7 @@ Bool_t TriggerSource::GetFirstBlock() const
 
 Bool_t TriggerSource::MoreBlocks() const
 {
-       return 0 <= fBlockIndex and fBlockIndex < NumberOfBlocks();
+       return 0 <= fBlockIndex && fBlockIndex < NumberOfBlocks();
 }
 
 
@@ -351,7 +351,7 @@ const TriggerRecord* TriggerSource::GetTrigger(Int_t triggernumber) const
        {
                Error("GetTrigger", "No block selected.");
                return NULL;
-       };
+       }
        
        // Try find the corresponding trigger record in the list of events.
        for (Int_t i = 0; i < fCurrentBlock->GetEntriesFast(); i++)
@@ -386,12 +386,12 @@ const TriggerRecord* TriggerSource::GetFirstTrigger() const
        }
        else
                return NULL;
-};
+}
 
 
 Bool_t TriggerSource::MoreTriggers() const
 {
-       return 0 <= fTriggerIndex and fTriggerIndex < NumberOfTriggers();
+       return 0 <= fTriggerIndex && fTriggerIndex < NumberOfTriggers();
 }
 
 
@@ -413,8 +413,8 @@ const TriggerRecord* TriggerSource::GetNextTrigger() const
        {
                ResetTriggerPointers();
                return NULL;
-       };
-};
+       }
+}
 
 
 Int_t TriggerSource::CurrentTrigger() const
@@ -458,7 +458,7 @@ void TriggerSource::AddBlock()
        {
                Error("AddBlock", "No event selected.");
                return;
-       };
+       }
        
        fBlockIndex = fCurrentEvent->fBlocks.GetEntriesFast();
        new ( fCurrentEvent->fBlocks[fBlockIndex] ) TClonesArray(TriggerRecord::Class());
@@ -501,7 +501,7 @@ Bool_t TriggerSource::FileAndFolderOk(AliMUONDataInterface* data)
                fFilename = data->CurrentFile();
                fFoldername = data->CurrentFolder();
                return kTRUE;
-       };
+       }
 
        if ( fFilename != data->CurrentFile() )
        {
@@ -510,7 +510,7 @@ Bool_t TriggerSource::FileAndFolderOk(AliMUONDataInterface* data)
                        fFilename.Data(), data->CurrentFile().Data()
                );
                return kFALSE;
-       };
+       }
        
        if ( fFoldername != data->CurrentFolder() )
        {
@@ -519,7 +519,7 @@ Bool_t TriggerSource::FileAndFolderOk(AliMUONDataInterface* data)
                        fFoldername.Data(), data->CurrentFolder().Data()
                );
                return kFALSE;
-       };
+       }
        
        return kTRUE;
 }
@@ -540,7 +540,7 @@ void TriggerSource::AddEventFrom(AliMUONDataInterface* data, AliMUON* module, In
                case FromHits:
                        for (Int_t track = 0; track < data->NumberOfTracks(); track++)
                        {
-                               if ( not FillTriggerFromHits(data, track, trigdata) )
+                               if ( ! FillTriggerFromHits(data, track, trigdata) )
                                        continue;  // Continue if unable to find hits.
 
                                if (InFillRegion(trigdata))
@@ -552,9 +552,9 @@ void TriggerSource::AddEventFrom(AliMUONDataInterface* data, AliMUON* module, In
                                        {
                                                AddBlock();
                                                currentblocksize = 0;
-                                       };
-                               };
-                       };
+                                       }
+                               }
+                       }
                        break;
 
                case FromLocalTriggers:
@@ -576,9 +576,9 @@ void TriggerSource::AddEventFrom(AliMUONDataInterface* data, AliMUON* module, In
                                        {
                                                AddBlock();
                                                currentblocksize = 0;
-                                       };
-                               };
-                       };
+                                       }
+                               }
+                       }
                        break;
 
                default:
@@ -599,7 +599,7 @@ void TriggerSource::AddTriggerFrom(AliMUONDataInterface* data, AliMUON* module,
        case FromHits:
                {
                // Note: in this case we treat the trigger parameter as a track number.
-               if ( not FillTriggerFromHits(data, trigger, trigdata) )
+               if ( ! FillTriggerFromHits(data, trigger, trigdata) )
                        return;  // Continue if unable to find hits.
                }
                break;
@@ -616,7 +616,7 @@ void TriggerSource::AddTriggerFrom(AliMUONDataInterface* data, AliMUON* module,
        default:
                Error("AddTriggerFrom", "fDataToUse is not set to a valid value.");
                return;
-       };
+       }
        
        AddTrigger(trigdata);
        
@@ -659,7 +659,7 @@ void TriggerSource::FillTriggerFromLocalTrigger(
        else
        {
                record.ParticleSign(0);
-       };
+       }
        DebugMsg(2, "Particle sign = " << record.ParticleSign() );
 
        // Compute the transverse momentum.
@@ -672,7 +672,7 @@ void TriggerSource::FillTriggerFromLocalTrigger(
        {
                Float_t pt = circuit.PtCal( trigger->LoStripX(), trigger->LoDev(), trigger->LoStripY() );
                record.Pt(pt);
-       };
+       }
        DebugMsg(2, "Pt = " << record.Pt() );
 
        // Build the impact points.
@@ -694,7 +694,7 @@ Bool_t TriggerSource::FillTriggerFromHits(AliMUONDataInterface* data, Int_t trac
        Float_t x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4;
 #ifndef __alpha
 #ifndef __sun
-       x1 = y1 = z1 = x2 = y2 = z2 = x3 = y3 = z3 = x4 = y4 = z4 = NAN;
+       x1 = y1 = z1 = x2 = y2 = z2 = x3 = y3 = z3 = x4 = y4 = z4 = nanf("");
 #else
        x1 = y1 = z1 = x2 = y2 = z2 = x3 = y3 = z3 = x4 = y4 = z4 = 0;
 #endif
@@ -704,7 +704,7 @@ Bool_t TriggerSource::FillTriggerFromHits(AliMUONDataInterface* data, Int_t trac
        // Find the hit that corresponds to chambers. 11 to 14. We can ignore any
        // hits above the first 14. If there are that many it means the particle
        // is cycling in the detector.
-       for (Int_t i = 0; i < data->NumberOfHits(track) and i < 14; i++)
+       for (Int_t i = 0; i < data->NumberOfHits(track) && i < 14; i++)
        {
                AliMUONHit* h = data->Hit(track, i);
 
@@ -718,8 +718,8 @@ Bool_t TriggerSource::FillTriggerFromHits(AliMUONDataInterface* data, Int_t trac
                case 12: x2 = h->X(); y2 = h->Y(); z2 = (Float_t)fabs(h->Z()); break;
                case 13: x3 = h->X(); y3 = h->Y(); z3 = (Float_t)fabs(h->Z()); break;
                case 14: x4 = h->X(); y4 = h->Y(); z4 = (Float_t)fabs(h->Z()); break;
-               };
-       };
+               }
+       }
        DebugMsg(4, "Found: x1 = " << x1 << ", y1 = " << y1 << ", z1 = " << z1);
        DebugMsg(4, "Found: x2 = " << x2 << ", y2 = " << y2 << ", z2 = " << z2);
        DebugMsg(4, "Found: x3 = " << x3 << ", y3 = " << y3 << ", z3 = " << z3);
@@ -727,13 +727,13 @@ Bool_t TriggerSource::FillTriggerFromHits(AliMUONDataInterface* data, Int_t trac
 
        // Get a coordinate for station 1, perferably from chamber 11 otherwise
        // use hits from chamber 12.
-       if (not TMath::IsNaN(x1))
+       if ( ! TMath::IsNaN(x1))
        {
                record.Station1Point().fX = x1;
                record.Station1Point().fY = y1;
                DebugMsg(3, "Using value from chamber 11: x1 = " << x1 << ", y1 = " << y1 << ", z1 = " << z1 );
        }
-       else if (not TMath::IsNaN(x2))
+       else if ( ! TMath::IsNaN(x2))
        {
                record.Station1Point().fX = x2;
                record.Station1Point().fY = y2;
@@ -745,18 +745,18 @@ Bool_t TriggerSource::FillTriggerFromHits(AliMUONDataInterface* data, Int_t trac
                // Return false if we could not find any hits on chambers 11 or 12.
                Warning("FillTriggerFromHits", "Could not find any hits on chambers 11 and 12.");
                return kFALSE;
-       };
+       }
 
        // Get a coordinate for station 2, perferably from chamber 13 otherwise
        // use hits from chamber 14.
-       if (not TMath::IsNaN(x3))
+       if ( ! TMath::IsNaN(x3))
        {
                record.Station2Point().fX = x3;
                record.Station2Point().fY = y3;
                z2 = z3;
                DebugMsg(3, "Using value from chamber 13: x3 = " << x3 << ", y3 = " << y3 << ", z3 = " << z3 );
        }
-       else if (not TMath::IsNaN(x4))
+       else if ( ! TMath::IsNaN(x4))
        {
                record.Station2Point().fX = x4;
                record.Station2Point().fY = y4;
@@ -768,7 +768,7 @@ Bool_t TriggerSource::FillTriggerFromHits(AliMUONDataInterface* data, Int_t trac
                // Return false if we could not find any hits on chambers 13 or 14.
                Warning("FillTriggerFromHits", "Could not find any hits on chambers 13 and 14.");
                return kFALSE;
-       };
+       }
        
        record.TriggerNumber(track);
        
@@ -815,14 +815,14 @@ Bool_t TriggerSource::FetchAliMUON(AliMUON*& module)
                // by setting the fHadToLoadgAlice to false.
                fHadToLoadgAlice = kFALSE;
                return kTRUE;
-       };
+       }
        
        AliRunLoader* runloader = AliRunLoader::GetRunLoader();
        if ( runloader == NULL )
        {
                Error("FetchAliMUON", "AliRunLoader not initialised!");
                return kFALSE;
-       };
+       }
 
        // Try fetch the AliRun object. If it is not found then try load it using
        // the runloader.
@@ -834,7 +834,7 @@ Bool_t TriggerSource::FetchAliMUON(AliMUON*& module)
                        // Error.
                        DebugMsg(1, "Leaving FillFrom(AliMUONDataInterface*)");
                        return kFALSE;
-               };
+               }
                fHadToLoadgAlice = kTRUE;
                alirun = runloader->GetAliRun();
        }
index e4f20dd4a997313237d8400943b72895b00e019b..972b67674fdddeaa86edb55177e4a1f079afc15a 100644 (file)
@@ -19,14 +19,14 @@ ostream& operator << (ostream& os, const EventID& id)
 {
        os << "<" << id.bunch << ":" << id.timestamp << ">";
        return os;
-};
+}
 
 
 ostream& operator << (ostream& os, const Point& p)
 {
        os << "[" << p.x << ", " << p.y << "]";
        return os;
-};
+}
 
 
 ostream& operator << (ostream& os, const ParticleSign s)
@@ -37,9 +37,9 @@ ostream& operator << (ostream& os, const ParticleSign s)
        case Plus:        os << "Plus";    break;
        case UnknownSign: os << "Unknown"; break;
        default:          os << "FAULT!";
-       };
+       }
        return os;
-};
+}
 
 
 ostream& operator << (ostream& os, const TriggerRecord& rec)
@@ -51,25 +51,25 @@ ostream& operator << (ostream& os, const TriggerRecord& rec)
        case Plus:        signstr = "Plus   "; break;
        case UnknownSign: signstr = "Unknown"; break;
        default:          signstr = "FAULT!!";
-       };
+       }
        
        os << "{ sign = " << signstr << ", pt = " 
           << rec.pt << ", impact on station 1: "
           << rec.station1impact << " , station 2: "
           << rec.station2impact << " }";
        return os;
-};
+}
 
 
 ostream& operator << (ostream& os, const ChamberID chamber)
 {
        Int ch = (Int)chamber;
-       if (0 <= ch and ch <= 9)
+       if (0 <= ch && ch <= 9)
                os << ch + 1;
        else
                os << "FAULT!!";
        return os;
-};
+}
 
 
-}; // dHLT
+} // dHLT
index a168c3585ae97f1b530bf1d6b41494705ec4c647..726af3050684e28bcbd5a6374838c5b92ab8e28b 100644 (file)
@@ -43,11 +43,11 @@ Float RegionOfInterest::planescale[NUMBER_OF_TRACKING_CHAMBERS]
 
 void RegionOfInterest::CreateToContain(const ClusterPoint& point, ChamberID chamber)
 {
-       Assert( 0 <= chamber and chamber < NUMBER_OF_TRACKING_CHAMBERS );
+       Assert( 0 <= chamber && chamber < NUMBER_OF_TRACKING_CHAMBERS );
        this->chamber = chamber;
        left = right = point.x;
        bottom = top = point.y;
-};
+}
 
 
 void RegionOfInterest::ExpandToContain(const ClusterPoint& point)
@@ -60,27 +60,29 @@ void RegionOfInterest::ExpandToContain(const ClusterPoint& point)
                bottom = point.y;
        else
                if (point.y > top) top = point.y;
-};
+}
 
 
 void RegionOfInterest::CreateToContain(const ClusterPoint* points, UInt count, ChamberID chamber)
 {
-       Assert( 0 <= chamber and chamber < NUMBER_OF_TRACKING_CHAMBERS );
+       Assert( 0 <= chamber && chamber < NUMBER_OF_TRACKING_CHAMBERS );
        Assert( count > 0 );
        
        CreateToContain(points[0], chamber);
        for (UInt i = 1; i < count; i++)
                ExpandToContain(points[i]);
-};
+}
 
 
 bool RegionOfInterest::InBounds()
 {
-       Assert( 0 <= chamber and chamber < NUMBER_OF_TRACKING_CHAMBERS );
+       Assert( 0 <= chamber && chamber < NUMBER_OF_TRACKING_CHAMBERS );
        register Float bound = planescale[chamber];
-       return -bound <= left and right <= bound
-               and -bound <= bottom and top <= bound;
-};
+       return -bound <= left
+         && right <= bound
+         && -bound <= bottom
+         && top <= bound;
+}
 
 
 #define MAX_LEVELS           13
@@ -123,7 +125,7 @@ UInt RegionOfInterest::indexoffsets[13]
 
 inline void RegionOfInterest::ConvertToGrid(register UInt& l, register UInt& r, register UInt& b, register UInt& t) const
 {
-       Assert( 0 <= chamber and chamber < NUMBER_OF_TRACKING_CHAMBERS );
+       Assert( 0 <= chamber && chamber < NUMBER_OF_TRACKING_CHAMBERS );
 
        register Float scale = planescale[chamber];
        l = (UInt) floor( (left / scale + 1.0f) * 0.5f * GRID_SIZE );
@@ -139,7 +141,7 @@ inline void RegionOfInterest::ConvertToGrid(register UInt& l, register UInt& r,
        Assert( b <= GRID_SIZE );
        Assert( t <= GRID_SIZE );
        */
-};
+}
 
 
 inline void RegionOfInterest::ConvertBackFromGrid(register UInt l, register UInt r, register UInt b, register UInt t)
@@ -149,13 +151,13 @@ inline void RegionOfInterest::ConvertBackFromGrid(register UInt l, register UInt
        Assert( b <= GRID_SIZE );
        Assert( t <= GRID_SIZE );
 
-       Assert( 0 <= chamber and chamber < NUMBER_OF_TRACKING_CHAMBERS );
+       Assert( 0 <= chamber && chamber < NUMBER_OF_TRACKING_CHAMBERS );
        register Float scale = planescale[chamber];
        left = ((Float)l / (Float)GRID_SIZE - 0.5f) * 2.0f * scale;
        right = ((Float)r / (Float)GRID_SIZE - 0.5f) * 2.0f * scale;
        bottom = ((Float)b / (Float)GRID_SIZE - 0.5f) * 2.0f * scale;
        top = ((Float)t / (Float)GRID_SIZE - 0.5f) * 2.0f * scale;
-};
+}
 
 
 ROI RegionOfInterest::Encode() const
@@ -171,18 +173,18 @@ ROI RegionOfInterest::Encode() const
        // More specificaly we search for which n,
        //   (l * 2^(-n) + 2) * 2^n >= r and (b * 2^(-n) + 2) * 2^n >= t
        
-       if ( ((l >> 6) + 2) << 6 >= r and ((b >> 6) + 2) << 6 >= t )
+       if ( ((l >> 6) + 2) << 6 >= r && ((b >> 6) + 2) << 6 >= t )
        {
-               if ( ((l >> 2) + 2) << 2 >= r and ((b >> 2) + 2) << 2 >= t )
+               if ( ((l >> 2) + 2) << 2 >= r && ((b >> 2) + 2) << 2 >= t )
                {
-                       if ( l + 2 >= r and b + 2 >= t )
+                       if ( l + 2 >= r && b + 2 >= t )
                        {
                                index = INDICES_TO_LEVEL_13;
                                maxwidth = (2 << 13) - 1;
                        }
                        else
                        {
-                               if ( ((l >> 1) + 2) << 1 >= r and ((b >> 1) + 2) << 1 >= t )
+                               if ( ((l >> 1) + 2) << 1 >= r && ((b >> 1) + 2) << 1 >= t )
                                {
                                        index = INDICES_TO_LEVEL_12;
                                        maxwidth = (2 << 12) - 1;
@@ -193,14 +195,14 @@ ROI RegionOfInterest::Encode() const
                                        index = INDICES_TO_LEVEL_11;
                                        maxwidth = (2 << 11) - 1;
                                        l >>= 2; b >>= 2;
-                               };
-                       };
+                               }
+                       }
                }
                else
                {
-                       if ( ((l >> 4) + 2) << 4 >= r and ((b >> 4) + 2) << 4 >= t )
+                       if ( ((l >> 4) + 2) << 4 >= r && ((b >> 4) + 2) << 4 >= t )
                        {
-                               if ( ((l >> 3) + 2) << 3 >= r and ((b >> 3) + 2) << 3 >= t )
+                               if ( ((l >> 3) + 2) << 3 >= r && ((b >> 3) + 2) << 3 >= t )
                                {
                                        index = INDICES_TO_LEVEL_10;
                                        maxwidth = (2 << 10) - 1;
@@ -211,11 +213,11 @@ ROI RegionOfInterest::Encode() const
                                        index = INDICES_TO_LEVEL_9;
                                        maxwidth = (2 << 9) - 1;
                                        l >>= 4; b >>= 4;
-                               };
+                               }
                        }
                        else
                        {
-                               if ( ((l >> 5) + 2) << 5 >= r and ((b >> 5) + 2) << 5 >= t )
+                               if ( ((l >> 5) + 2) << 5 >= r && ((b >> 5) + 2) << 5 >= t )
                                {
                                        index = INDICES_TO_LEVEL_8;
                                        maxwidth = (2 << 8) - 1;
@@ -226,17 +228,17 @@ ROI RegionOfInterest::Encode() const
                                        index = INDICES_TO_LEVEL_7;
                                        maxwidth = (2 << 7) - 1;
                                        l >>= 6; b >>= 6;
-                               };
-                       };
-               };
+                               }
+                       }
+               }
        }
        else
        {
-               if ( ((l >> 10) + 2) << 10 >= r and ((b >> 10) + 2) << 10 >= t )
+               if ( ((l >> 10) + 2) << 10 >= r && ((b >> 10) + 2) << 10 >= t )
                {
-                       if ( ((l >> 8) + 2) << 8 >= r and ((b >> 8) + 2) << 8 >= t )
+                       if ( ((l >> 8) + 2) << 8 >= r && ((b >> 8) + 2) << 8 >= t )
                        {
-                               if ( ((l >> 7) + 2) << 7 >= r and ((b >> 7) + 2) << 7 >= t )
+                               if ( ((l >> 7) + 2) << 7 >= r && ((b >> 7) + 2) << 7 >= t )
                                {
                                        index = INDICES_TO_LEVEL_6;
                                        maxwidth = (2 << 6) - 1;
@@ -247,11 +249,11 @@ ROI RegionOfInterest::Encode() const
                                        index = INDICES_TO_LEVEL_5;
                                        maxwidth = (2 << 5) - 1;
                                        l >>= 8; b >>= 8;
-                               };
+                               }
                        }
                        else
                        {
-                               if ( ((l >> 9) + 2) << 9 >= r and ((b >> 9) + 2) << 9 >= t )
+                               if ( ((l >> 9) + 2) << 9 >= r && ((b >> 9) + 2) << 9 >= t )
                                {
                                        index = INDICES_TO_LEVEL_4;
                                        maxwidth = (2 << 4) - 1;
@@ -262,14 +264,14 @@ ROI RegionOfInterest::Encode() const
                                        index = INDICES_TO_LEVEL_3;
                                        maxwidth = (2 << 3) - 1;
                                        l >>= 10; b >>= 10;
-                               };
-                       };
+                               }
+                       }
                }
                else
                {
-                       if ( ((l >> 12) + 2) << 12 >= r and ((b >> 12) + 2) << 12 >= t )
+                       if ( ((l >> 12) + 2) << 12 >= r && ((b >> 12) + 2) << 12 >= t )
                        {
-                               if ( ((l >> 11) + 2) << 11 >= r and ((b >> 11) + 2) << 11 >= t )
+                               if ( ((l >> 11) + 2) << 11 >= r && ((b >> 11) + 2) << 11 >= t )
                                {
                                        index = INDICES_TO_LEVEL_2;
                                        maxwidth = (2 << 2) - 1;
@@ -280,16 +282,16 @@ ROI RegionOfInterest::Encode() const
                                        index = INDICES_TO_LEVEL_1;
                                        maxwidth = (2 << 1) - 1;
                                        l >>= 12; b >>= 12;
-                               };
+                               }
                        }
                        else
                        {
                                index = 0;
                                maxwidth = 0;
                                l = 0; b = 0;
-                       };
-               };
-       };
+                       }
+               }
+       }
        
        // Make sure the ROI boundary box does not go outside the
        // global region of interest.
@@ -297,7 +299,7 @@ ROI RegionOfInterest::Encode() const
        if ( b > maxwidth - 1 ) b = maxwidth - 1;
        
        return MAX_INDICES * chamber + b * maxwidth + l + index;
-};
+}
 
 
 ROI RegionOfInterest::Encode(UChar& level, UInt& l, UInt& b) const
@@ -313,11 +315,11 @@ ROI RegionOfInterest::Encode(UChar& level, UInt& l, UInt& b) const
        // More specificaly we search for which n,
        //   (l * 2^(-n) + 2) * 2^n >= r and (b * 2^(-n) + 2) * 2^n >= t
        
-       if ( ((l >> 6) + 2) << 6 >= r and ((b >> 6) + 2) << 6 >= t )
+       if ( ((l >> 6) + 2) << 6 >= r && ((b >> 6) + 2) << 6 >= t )
        {
-               if ( ((l >> 2) + 2) << 2 >= r and ((b >> 2) + 2) << 2 >= t )
+               if ( ((l >> 2) + 2) << 2 >= r && ((b >> 2) + 2) << 2 >= t )
                {
-                       if ( l + 2 >= r and b + 2 >= t )
+                       if ( l + 2 >= r && b + 2 >= t )
                        {
                                level = 13;
                                index = INDICES_TO_LEVEL_13;
@@ -325,7 +327,7 @@ ROI RegionOfInterest::Encode(UChar& level, UInt& l, UInt& b) const
                        }
                        else
                        {
-                               if ( ((l >> 1) + 2) << 1 >= r and ((b >> 1) + 2) << 1 >= t )
+                               if ( ((l >> 1) + 2) << 1 >= r && ((b >> 1) + 2) << 1 >= t )
                                {
                                        level = 12;
                                        index = INDICES_TO_LEVEL_12;
@@ -338,14 +340,14 @@ ROI RegionOfInterest::Encode(UChar& level, UInt& l, UInt& b) const
                                        index = INDICES_TO_LEVEL_11;
                                        maxwidth = (2 << 11) - 1;
                                        l >>= 2; b >>= 2;
-                               };
-                       };
+                               }
+                       }
                }
                else
                {
-                       if ( ((l >> 4) + 2) << 4 >= r and ((b >> 4) + 2) << 4 >= t )
+                       if ( ((l >> 4) + 2) << 4 >= r && ((b >> 4) + 2) << 4 >= t )
                        {
-                               if ( ((l >> 3) + 2) << 3 >= r and ((b >> 3) + 2) << 3 >= t )
+                               if ( ((l >> 3) + 2) << 3 >= r && ((b >> 3) + 2) << 3 >= t )
                                {
                                        level = 10;
                                        index = INDICES_TO_LEVEL_10;
@@ -358,11 +360,11 @@ ROI RegionOfInterest::Encode(UChar& level, UInt& l, UInt& b) const
                                        index = INDICES_TO_LEVEL_9;
                                        maxwidth = (2 << 9) - 1;
                                        l >>= 4; b >>= 4;
-                               };
+                               }
                        }
                        else
                        {
-                               if ( ((l >> 5) + 2) << 5 >= r and ((b >> 5) + 2) << 5 >= t )
+                               if ( ((l >> 5) + 2) << 5 >= r && ((b >> 5) + 2) << 5 >= t )
                                {
                                        level = 8;
                                        index = INDICES_TO_LEVEL_8;
@@ -375,17 +377,17 @@ ROI RegionOfInterest::Encode(UChar& level, UInt& l, UInt& b) const
                                        index = INDICES_TO_LEVEL_7;
                                        maxwidth = (2 << 7) - 1;
                                        l >>= 6; b >>= 6;
-                               };
-                       };
-               };
+                               }
+                       }
+               }
        }
        else
        {
-               if ( ((l >> 10) + 2) << 10 >= r and ((b >> 10) + 2) << 10 >= t )
+               if ( ((l >> 10) + 2) << 10 >= r && ((b >> 10) + 2) << 10 >= t )
                {
-                       if ( ((l >> 8) + 2) << 8 >= r and ((b >> 8) + 2) << 8 >= t )
+                       if ( ((l >> 8) + 2) << 8 >= r && ((b >> 8) + 2) << 8 >= t )
                        {
-                               if ( ((l >> 7) + 2) << 7 >= r and ((b >> 7) + 2) << 7 >= t )
+                               if ( ((l >> 7) + 2) << 7 >= r && ((b >> 7) + 2) << 7 >= t )
                                {
                                        level = 6;
                                        index = INDICES_TO_LEVEL_6;
@@ -398,11 +400,11 @@ ROI RegionOfInterest::Encode(UChar& level, UInt& l, UInt& b) const
                                        index = INDICES_TO_LEVEL_5;
                                        maxwidth = (2 << 5) - 1;
                                        l >>= 8; b >>= 8;
-                               };
+                               }
                        }
                        else
                        {
-                               if ( ((l >> 9) + 2) << 9 >= r and ((b >> 9) + 2) << 9 >= t )
+                               if ( ((l >> 9) + 2) << 9 >= r && ((b >> 9) + 2) << 9 >= t )
                                {
                                        level = 4;
                                        index = INDICES_TO_LEVEL_4;
@@ -415,14 +417,14 @@ ROI RegionOfInterest::Encode(UChar& level, UInt& l, UInt& b) const
                                        index = INDICES_TO_LEVEL_3;
                                        maxwidth = (2 << 3) - 1;
                                        l >>= 10; b >>= 10;
-                               };
-                       };
+                               }
+                       }
                }
                else
                {
-                       if ( ((l >> 12) + 2) << 12 >= r and ((b >> 12) + 2) << 12 >= t )
+                       if ( ((l >> 12) + 2) << 12 >= r && ((b >> 12) + 2) << 12 >= t )
                        {
-                               if ( ((l >> 11) + 2) << 11 >= r and ((b >> 11) + 2) << 11 >= t )
+                               if ( ((l >> 11) + 2) << 11 >= r && ((b >> 11) + 2) << 11 >= t )
                                {
                                        level = 2;
                                        index = INDICES_TO_LEVEL_2;
@@ -435,7 +437,7 @@ ROI RegionOfInterest::Encode(UChar& level, UInt& l, UInt& b) const
                                        index = INDICES_TO_LEVEL_1;
                                        maxwidth = (2 << 1) - 1;
                                        l >>= 12; b >>= 12;
-                               };
+                               }
                        }
                        else
                        {
@@ -443,9 +445,9 @@ ROI RegionOfInterest::Encode(UChar& level, UInt& l, UInt& b) const
                                index = 0;
                                maxwidth = 0;
                                l = 0; b = 0;
-                       };
-               };
-       };
+                       }
+               }
+       }
        
        // Make sure the ROI boundary box does not go outside the
        // global region of interest.
@@ -453,7 +455,7 @@ ROI RegionOfInterest::Encode(UChar& level, UInt& l, UInt& b) const
        if ( b > maxwidth - 1 ) b = maxwidth - 1;
        
        return MAX_INDICES * chamber + b * maxwidth + l + index;
-};
+}
 
 
 void RegionOfInterest::Decode(ROI code)
@@ -471,7 +473,7 @@ void RegionOfInterest::Decode(ROI code)
        t = b + (2 << colevel);
 
        ConvertBackFromGrid(l, r, b, t);
-};
+}
 
 
 void RegionOfInterest::Decode(ROI code, ChamberID& chamber, UChar& level, UInt& l, UInt& b)
@@ -479,7 +481,7 @@ void RegionOfInterest::Decode(ROI code, ChamberID& chamber, UChar& level, UInt&
        UChar colevel;
        DecodeBits(code, chamber, colevel, l, b);
        level = MAX_LEVELS - colevel;
-};
+}
 
 
 void RegionOfInterest::DecodeBits(ROI code, ChamberID& chamber, UChar& colevel, UInt& l, UInt& b)
@@ -515,8 +517,8 @@ void RegionOfInterest::DecodeBits(ROI code, ChamberID& chamber, UChar& colevel,
                                        index -= INDICES_TO_LEVEL_11;
                                        width = (2 << 11) - 1;
                                        colevel = 2;
-                               };
-                       };
+                               }
+                       }
                }
                else
                {
@@ -533,7 +535,7 @@ void RegionOfInterest::DecodeBits(ROI code, ChamberID& chamber, UChar& colevel,
                                        index -= INDICES_TO_LEVEL_9;
                                        width = (2 << 9) - 1;
                                        colevel = 4;
-                               };
+                               }
                        }
                        else
                        {
@@ -548,9 +550,9 @@ void RegionOfInterest::DecodeBits(ROI code, ChamberID& chamber, UChar& colevel,
                                        index -= INDICES_TO_LEVEL_7;
                                        width = (2 << 7) - 1;
                                        colevel = 6;
-                               };
-                       };
-               };
+                               }
+                       }
+               }
        }
        else
        {
@@ -569,7 +571,7 @@ void RegionOfInterest::DecodeBits(ROI code, ChamberID& chamber, UChar& colevel,
                                        index -= INDICES_TO_LEVEL_5;
                                        width = (2 << 5) - 1;
                                        colevel = 8;
-                               };
+                               }
                        }
                        else
                        {
@@ -584,8 +586,8 @@ void RegionOfInterest::DecodeBits(ROI code, ChamberID& chamber, UChar& colevel,
                                        index -= INDICES_TO_LEVEL_3;
                                        width = (2 << 3) - 1;
                                        colevel = 10;
-                               };
-                       };
+                               }
+                       }
                }
                else
                {
@@ -602,27 +604,27 @@ void RegionOfInterest::DecodeBits(ROI code, ChamberID& chamber, UChar& colevel,
                                        index -= INDICES_TO_LEVEL_1;
                                        width = (2 << 1) - 1;
                                        colevel = 12;
-                               };
+                               }
                        }
                        else
                        {
                                width = 1;
                                colevel = 13;
-                       };
-               };
-       };
+                       }
+               }
+       }
 
        // Can now decode the x, y position of the bottom left corner
        // of the ROI boundary box.
        b = (index / width);
        l = (index % width);
-};
+}
 
 
 ChamberID RegionOfInterest::DecodeChamber(ROI code)
 {
        return (ChamberID)(code / MAX_INDICES);
-};
+}
 
 
 } // dHLT
index 0d78fff7caf7aec45dbb403f040ac49561eee78d..4ef121ef0446fa37bd0514dd8e617f20a8845a30 100644 (file)
@@ -89,7 +89,7 @@ public:
         */
        RegionOfInterest(Float left0, Float right0, Float bottom0, Float top0, ChamberID chamber0)
        {
-               Assert( 0 <= chamber0 and chamber0 < NUMBER_OF_TRACKING_CHAMBERS );
+               Assert( 0 <= chamber0 && chamber0 < NUMBER_OF_TRACKING_CHAMBERS );
                this->chamber = chamber0;
                this->left = left0;
                this->right = right0;
@@ -102,8 +102,10 @@ public:
         */
        bool Contains(const ClusterPoint& point) const
        {
-               return left <= point.x and point.x <= right and
-                       bottom <= point.y and point.y <= top;
+               return left <= point.x 
+                 && point.x <= right 
+                 && bottom <= point.y
+                 && point.y <= top;
        }
 
 
@@ -112,9 +114,11 @@ public:
         */
        bool Contains(const ClusterPoint& point, ChamberID chamber0) const
        {
-               return left <= point.x and point.x <= right and
-                       bottom <= point.y and point.y <= top and
-                       this->chamber == chamber0;
+               return left <= point.x 
+                 && point.x <= right
+                 && bottom <= point.y
+                 && point.y <= top
+                 && this->chamber == chamber0;
        }
 
 
@@ -123,9 +127,11 @@ public:
         */
        bool Contains(const RegionOfInterest& roi) const
        {
-               return chamber == roi.chamber and 
-                       left <= roi.left and right >= roi.right and
-                       bottom <= roi.bottom and top >= roi.top;
+               return chamber == roi.chamber
+                 && left <= roi.left
+                 && right >= roi.right
+                 && bottom <= roi.bottom
+                 && top >= roi.top;
        }
 
 
index 41d0191d7e0383227ed14bcad562176646187618..97a469a496ada0476a167ba1fca9e43d3a699752 100644 (file)
@@ -31,9 +31,9 @@ std::ostream& operator << (std::ostream& os, MansoTracker::StatesSM4 state)
        case MansoTracker::WaitChamber7:     os << "WaitChamber7"; break;
        case MansoTracker::WaitMoreChamber7: os << "WaitMoreChamber7"; break;
        default:                             os << "FAULT!!"; 
-       };
+       }
        return os;
-};
+}
 
 std::ostream& operator << (std::ostream& os, MansoTracker::StatesSM5 state)
 {
@@ -46,9 +46,9 @@ std::ostream& operator << (std::ostream& os, MansoTracker::StatesSM5 state)
        case MansoTracker::WaitMoreChamber9:  os << "WaitMoreChamber9"; break;
        case MansoTracker::SM5Done:           os << "SM5Done"; break;
        default:                              os << "FAULT!!"; 
-       };
+       }
        return os;
-};
+}
 
 } // end of namespace
 #endif // DEBUG
@@ -95,7 +95,7 @@ void MansoTracker::RegionOfInterest::Create(Point p, Float a, Float b)
        //     Rs = a * Rp + b
        //   given on page 3 section 4.
        Rs = a * Rp + b;
-};
+}
 
 
 bool MansoTracker::RegionOfInterest::Contains(Point p) const
@@ -110,7 +110,7 @@ bool MansoTracker::RegionOfInterest::Contains(Point p) const
                << " , centre = " << centre << " , r = " << r << " , Rs = " << Rs
        );
        return r <= Rs;
-};
+}
 
 
 void MansoTracker::RegionOfInterest::GetBoundaryBox(Float& left, Float& right, Float& bottom, Float& top)
@@ -119,7 +119,7 @@ void MansoTracker::RegionOfInterest::GetBoundaryBox(Float& left, Float& right, F
        right = centre.x + Rs;
        bottom = centre.y - Rs;
        top = centre.y + Rs;
-};
+}
 
 
 MansoTracker::Vertex::Vertex(Float x, Float y, Float z)
@@ -127,7 +127,7 @@ MansoTracker::Vertex::Vertex(Float x, Float y, Float z)
        this->x = x;
        this->y = y;
        this->z = z;
-};
+}
 
 
 MansoTracker::Vertex::Vertex(Point xy, Float z)
@@ -135,7 +135,7 @@ MansoTracker::Vertex::Vertex(Point xy, Float z)
        x = xy.x;
        y = xy.y;
        this->z = z;
-};
+}
 
 
 MansoTracker::Line::Line(
@@ -149,7 +149,7 @@ MansoTracker::Line::Line(
        Cx = Bx;
        Cy = By;
        Cz = Bz;
-};
+}
 
 
 MansoTracker::Line::Line(Vertex A, Vertex B)
@@ -160,7 +160,7 @@ MansoTracker::Line::Line(Vertex A, Vertex B)
        Cx = B.x;
        Cy = B.y;
        Cz = B.z;
-};
+}
 
 
 Point MansoTracker::Line::FindIntersectWithXYPlain(Float z) const
@@ -171,7 +171,7 @@ Point MansoTracker::Line::FindIntersectWithXYPlain(Float z) const
        Float Ly = My*t + Cy;
 
        return Point(Lx, Ly);
-};
+}
 
 
 MansoTracker::MansoTracker() : Tracker()
@@ -179,7 +179,7 @@ MansoTracker::MansoTracker() : Tracker()
        sm4state = SM4Idle;
        sm5state = SM5Idle;
        requests_completed = 0;
-};
+}
 
 
 void MansoTracker::FindTrack(const TriggerRecord& trigger)
@@ -207,7 +207,7 @@ void MansoTracker::FindTrack(const TriggerRecord& trigger)
        Float left, right, bottom, top;
        mc1.roi.GetBoundaryBox(left, right, bottom, top);
        RequestClusters(left, right, bottom, top, Chamber10, &mc1);
-};
+}
 
 
 void MansoTracker::ReturnClusters(void* tag, const ClusterPoint* clusters, UInt count)
@@ -231,8 +231,8 @@ void MansoTracker::ReturnClusters(void* tag, const ClusterPoint* clusters, UInt
        default:
                // Error
                DebugMsg(1, "ERROR: Got tag with an invalid value: " << data->chamber);
-       };
-};
+       }
+}
 
 
 void MansoTracker::EndOfClusters(void* tag)
@@ -250,8 +250,8 @@ void MansoTracker::EndOfClusters(void* tag)
        default:
                // Error
                DebugMsg(1, "ERROR: Got tag with an invalid value: " << data->chamber);
-       };
-};
+       }
+}
 
 
 void MansoTracker::FillTrackData(Track& track)
@@ -281,7 +281,7 @@ void MansoTracker::FillTrackData(Track& track)
        {
                track.point[i] = Point(0.0, 0.0);
                track.region[i] = INVALID_ROI;
-       };
+       }
 
        Float left, right, bottom, top;
        
@@ -306,7 +306,7 @@ void MansoTracker::FillTrackData(Track& track)
                track.region[6] = region4;
                track.point[7] = Point(0.0, 0.0);
                track.region[7] = INVALID_ROI;
-       };
+       }
        if (mc1.chamber == Chamber10)
        {
                track.point[8] = Point(0.0, 0.0);
@@ -320,8 +320,8 @@ void MansoTracker::FillTrackData(Track& track)
                track.region[8] = region5;
                track.point[9] = Point(0.0, 0.0);
                track.region[9] = INVALID_ROI;
-       };
-};
+       }
+}
 
 
 void MansoTracker::Reset()
@@ -332,7 +332,7 @@ void MansoTracker::Reset()
        sm4state = SM4Idle;
        sm5state = SM5Idle;
        requests_completed = 0;
-};
+}
 
 
 // Note: In the following ReceiveClustersXXX and EndOfClustersXXX methods we make
@@ -362,14 +362,14 @@ void MansoTracker::ReceiveClustersChamber7(const ClusterPoint* clusters, UInt co
                                Station4Data* newdata = st4points.New();
                                newdata->clusterpoint = cluster;
                                newdata->st5tag = data;
-                       };
-               };
+                       }
+               }
                break;
        
        default:
                DebugMsg(1, "ERROR: Unexpected state for SM4 in MansoTracker::ReceiveClustersChamber7!");
-       };
-};
+       }
+}
 
 
 void MansoTracker::ReceiveClustersChamber8(const ClusterPoint* clusters, UInt count, const TagData* data)
@@ -392,14 +392,14 @@ void MansoTracker::ReceiveClustersChamber8(const ClusterPoint* clusters, UInt co
                                Station4Data* newdata = st4points.New();
                                newdata->clusterpoint = cluster;
                                newdata->st5tag = data;
-                       };
-               };
+                       }
+               }
                break;
                
        default:
                DebugMsg(1, "ERROR: Unexpected state for SM4 in MansoTracker::ReceiveClustersChamber8!");
-       };
-};
+       }
+}
 
 
 void MansoTracker::ReceiveClustersChamber9(const ClusterPoint* clusters, UInt count)
@@ -421,14 +421,14 @@ void MansoTracker::ReceiveClustersChamber9(const ClusterPoint* clusters, UInt co
                                Station5Data* data = st5data.New();
                                data->clusterpoint = cluster;
                                ProjectToStation4(data, z9);  // This adds a new request for station 4.
-                       };
-               };
+                       }
+               }
                break;
 
        default:
                DebugMsg(1, "ERROR: Unexpected state for SM5 in MansoTracker::ReceiveClustersChamber9!");
-       };
-};
+       }
+}
 
 
 void MansoTracker::ReceiveClustersChamber10(const ClusterPoint* clusters, UInt count)
@@ -451,14 +451,14 @@ void MansoTracker::ReceiveClustersChamber10(const ClusterPoint* clusters, UInt c
                                Station5Data* data = st5data.New();
                                data->clusterpoint = cluster;
                                ProjectToStation4(data, z10);  // This adds a new request for station 4.
-                       };
-               };
+                       }
+               }
                break;
 
        default:
                DebugMsg(1, "ERROR: Unexpected state for SM5 in MansoTracker::ReceiveClustersChamber10!");
-       };
-};
+       }
+}
 
 
 void MansoTracker::EndOfClustersChamber7()
@@ -475,14 +475,14 @@ void MansoTracker::EndOfClustersChamber7()
                break;
        
        case WaitMoreChamber7:
-               if (requests_completed == st5data.Count() and sm5state == SM5Done)
+               if (requests_completed == st5data.Count() && sm5state == SM5Done)
                        ProcessClusters();
                break;
        
        default:
                DebugMsg(1, "ERROR: Unexpected state for SM4 in MansoTracker::EndOfClustersChamber7!");
-       };
-};
+       }
+}
 
 
 void MansoTracker::EndOfClustersChamber8()
@@ -525,19 +525,19 @@ void MansoTracker::EndOfClustersChamber8()
                        data->tag.roi.GetBoundaryBox(left, right, bottom, top);
                        // Make request for chamber 7 data.
                        RequestClusters(left, right, bottom, top, Chamber7, &data->tag);
-               };
+               }
                }
                break;
        
        case WaitMoreChamber8:
-               if (requests_completed == st5data.Count() and sm5state == SM5Done)
+               if (requests_completed == st5data.Count() && sm5state == SM5Done)
                        ProcessClusters();
                break;
        
        default:
                DebugMsg(1, "ERROR: Unexpected state for SM4 in MansoTracker::EndOfClustersChamber8!");
-       };
-};
+       }
+}
 
 
 void MansoTracker::EndOfClustersChamber9()
@@ -559,8 +559,8 @@ void MansoTracker::EndOfClustersChamber9()
 
        default:
                DebugMsg(1, "ERROR: Unexpected state for SM5 in MansoTracker::EndOfClustersChamber9!");
-       };
-};
+       }
+}
 
 
 void MansoTracker::EndOfClustersChamber10()
@@ -596,8 +596,8 @@ void MansoTracker::EndOfClustersChamber10()
 
        default:
                DebugMsg(1, "ERROR: Unexpected state for SM5 in MansoTracker::EndOfClustersChamber10!");
-       };
-};
+       }
+}
 
 
 void MansoTracker::ProjectToStation4(Station5Data* data, register Float station5z)
@@ -606,11 +606,13 @@ void MansoTracker::ProjectToStation4(Station5Data* data, register Float station5
        // Since certain states of SM4 means that it is fetching for Chamber8
        // and other states are for fetching from Chamber7. We need to make
        // requests for the correct chamber.
-       Assert( sm4state == WaitChamber8 or sm4state == WaitMoreChamber8 or
-               sm4state == WaitChamber7 or sm4state == WaitMoreChamber7
+       Assert( sm4state == WaitChamber8 
+               || sm4state == WaitMoreChamber8
+               || sm4state == WaitChamber7
+               || sm4state == WaitMoreChamber7
        );
        TagData* tag = &data->tag;
-       if (sm4state == WaitChamber8 or sm4state == WaitMoreChamber8)
+       if (sm4state == WaitChamber8 || sm4state == WaitMoreChamber8)
        {
                // Form the vector line between trigger station 1 and tracking station 5,
                // and find the intersection point of the line with station 4 (chamber8).
@@ -633,13 +635,13 @@ void MansoTracker::ProjectToStation4(Station5Data* data, register Float station5
                // Build a region of interest for tracking station 4.
                tag->chamber = Chamber7;
                tag->roi.Create(intercept, a7, b7);
-       };
+       }
 
        // Make the request for clusters from station 4.
        Float left, right, bottom, top;
        tag->roi.GetBoundaryBox(left, right, bottom, top);
        RequestClusters(left, right, bottom, top, tag->chamber, tag);
-};
+}
 
 
 void MansoTracker::ProcessClusters()
@@ -653,7 +655,7 @@ void MansoTracker::ProcessClusters()
        {
                NoTrackFound();
                return;
-       };
+       }
        
        st5rec = st5data.First();
        if (st5rec != st5data.End())
@@ -667,7 +669,7 @@ void MansoTracker::ProcessClusters()
                {
                        NoTrackFound();
                        return;
-               };
+               }
                 
                // For all combinations of cluster point pairs from station 4 and 5
                // signal a found track:
@@ -684,11 +686,11 @@ void MansoTracker::ProcessClusters()
                        }
 
                        st5rec++;  // Get next station 5 cluster point.
-               } while (st5rec != st5data.End() and st5rec->tag.chamber == st4chamber);
+               } while (st5rec != st5data.End() && st5rec->tag.chamber == st4chamber);
        }
        else
                NoTrackFound();
-};
+}
 
 
 } // Tracking