]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
added -verbose option to prevent couts and warnings during normal execution
authorfronchet <fronchet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 9 Jun 2010 12:11:19 +0000 (12:11 +0000)
committerfronchet <fronchet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 9 Jun 2010 12:11:19 +0000 (12:11 +0000)
HLT/EMCAL/AliHLTEMCALRawHistoMaker.cxx
HLT/EMCAL/AliHLTEMCALRawHistoMaker.h
HLT/EMCAL/AliHLTEMCALRawHistoMakerComponent.cxx
HLT/EMCAL/AliHLTEMCALRawHistoMakerComponent.h

index 8189b2d2b4644559ace1ef31550ee8f0ff263c7d..524b86ffc79e9f5ce93874c91187f4ebe66accc4 100644 (file)
@@ -119,9 +119,9 @@ TObjArray* AliHLTEMCALRawHistoMaker::GetHistograms()
 Int_t\r
 AliHLTEMCALRawHistoMaker::MakeHisto(AliHLTCaloChannelDataHeaderStruct* channelDataHeader,\r
                const AliHLTComponentBlockData* iter, AliHLTUInt8_t* outputPtr,\r
 Int_t\r
 AliHLTEMCALRawHistoMaker::MakeHisto(AliHLTCaloChannelDataHeaderStruct* channelDataHeader,\r
                const AliHLTComponentBlockData* iter, AliHLTUInt8_t* outputPtr,\r
-               const AliHLTUInt32_t size)\r
+               const AliHLTUInt32_t size, int beverbose)\r
 {\r
 {\r
-       int tmpsize=  0;\r
+       //int tmpsize =  0;\r
        Int_t crazyness          = 0;\r
        Int_t nSamples           = 0;\r
        Short_t channelCount     = 0;\r
        Int_t crazyness          = 0;\r
        Int_t nSamples           = 0;\r
        Short_t channelCount     = 0;\r
@@ -135,7 +135,6 @@ AliHLTEMCALRawHistoMaker::MakeHisto(AliHLTCaloChannelDataHeaderStruct* channelDa
 \r
        fRawCounterMemoryPtr->SetMemory( reinterpret_cast<UChar_t*>( iter->fPtr ),  static_cast<ULong_t>( iter->fSize )  );\r
        fRawCounterMemoryPtr->SetEquipmentID(    fMapperPtr->GetDDLFromSpec(  iter->fSpecification) + fCaloConstants->GetDDLOFFSET() );\r
 \r
        fRawCounterMemoryPtr->SetMemory( reinterpret_cast<UChar_t*>( iter->fPtr ),  static_cast<ULong_t>( iter->fSize )  );\r
        fRawCounterMemoryPtr->SetEquipmentID(    fMapperPtr->GetDDLFromSpec(  iter->fSpecification) + fCaloConstants->GetDDLOFFSET() );\r
-\r
        fRawCounterMemoryPtr->Reset();\r
 \r
        //fRawCounterMemoryPtr->NextEvent();\r
        fRawCounterMemoryPtr->Reset();\r
 \r
        //fRawCounterMemoryPtr->NextEvent();\r
@@ -153,7 +152,8 @@ AliHLTEMCALRawHistoMaker::MakeHisto(AliHLTCaloChannelDataHeaderStruct* channelDa
 \r
                UInt_t eventType = fRawCounterMemoryPtr->GetType();\r
 \r
 \r
                UInt_t eventType = fRawCounterMemoryPtr->GetType();\r
 \r
-               //cout << "event type: " << eventType << endl;\r
+               if (beverbose)\r
+                       cout << "I-RAWHISTOMAKER: event type: " << eventType << endl;\r
 \r
 //             if (eventType != AliRawEventHeaderBase::kPhysicsEvent) continue;\r
 \r
 \r
 //             if (eventType != AliRawEventHeaderBase::kPhysicsEvent) continue;\r
 \r
index 56e6c5944f841f35d4d779b73474bad8711acd1e..4bd783948228469a176cb406dd2e21cfe4930eef 100644 (file)
@@ -84,7 +84,7 @@ public:
 \r
   Int_t MakeHisto(AliHLTCaloChannelDataHeaderStruct* channelDataHeader,\r
                  const AliHLTComponentBlockData* iter, AliHLTUInt8_t* outputPtr,\r
 \r
   Int_t MakeHisto(AliHLTCaloChannelDataHeaderStruct* channelDataHeader,\r
                  const AliHLTComponentBlockData* iter, AliHLTUInt8_t* outputPtr,\r
-                 const AliHLTUInt32_t size);\r
+                 const AliHLTUInt32_t size, int beverbose);\r
 \r
   TObjArray * GetHistograms();\r
 \r
 \r
   TObjArray * GetHistograms();\r
 \r
index 695562bb74147b1e0d2538cedb96af33a630591a..d052ccb4e8614d311d93c128072e33b155e733a9 100644 (file)
@@ -47,7 +47,8 @@ AliHLTEMCALRawHistoMakerComponent::AliHLTEMCALRawHistoMakerComponent() :
                                  fRawHistoMakerPtr(0),
                                  fPushFraction(10),
                                  fLocalEventCount(0),
                                  fRawHistoMakerPtr(0),
                                  fPushFraction(10),
                                  fLocalEventCount(0),
-                                 fRootFileName("histo_local_dump.root")
+                                 fRootFileName("histofile_local.root"),
+                                 fBeVerbose(0)
 {
        //see header file for documentation
 }
 {
        //see header file for documentation
 }
@@ -75,7 +76,7 @@ const char*
 AliHLTEMCALRawHistoMakerComponent::GetComponentID()
 {
        //see header file for documentation
 AliHLTEMCALRawHistoMakerComponent::GetComponentID()
 {
        //see header file for documentation
-       return "EMCALRawHistoMaker";
+       return "EmcalRawHistoMaker";
 }
 
 
 }
 
 
@@ -121,15 +122,23 @@ AliHLTEMCALRawHistoMakerComponent::DoEvent(const AliHLTComponentEventData& evtDa
        UInt_t specification = 0;
        AliHLTCaloChannelDataHeaderStruct* tmpChannelData = 0;
 
        UInt_t specification = 0;
        AliHLTCaloChannelDataHeaderStruct* tmpChannelData = 0;
 
+
        for( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
        {
                iter = blocks+ndx;
        for( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
        {
                iter = blocks+ndx;
-               //cout << " into do event and into to for loop !!! " << endl;
-               //PrintComponentDataTypeInfo(iter->fDataType);
+
+               if (fBeVerbose) {
+                       PrintComponentDataTypeInfo(iter->fDataType);
+                       cout << "I-RAWHISTOMAKERCOMPONENT: verbose mode enabled:  " << fBeVerbose << endl;
+               }
 
                if(iter->fDataType != AliHLTEMCALDefinitions::fgkChannelDataType)
                {
 
                if(iter->fDataType != AliHLTEMCALDefinitions::fgkChannelDataType)
                {
-                       HLTDebug("Data block is not of type fgkChannelDataType");
+
+                       if (fBeVerbose)
+                               HLTWarning("I-RAWHISTOMAKERCOMPONENT: Data block is not of type fgkChannelDataType");
+                       else
+                               HLTDebug("I-RAWHISTOMAKERCOMPONENT: Data block is not of type fgkChannelDataType");
 
                        continue;
                }
 
                        continue;
                }
@@ -137,9 +146,10 @@ AliHLTEMCALRawHistoMakerComponent::DoEvent(const AliHLTComponentEventData& evtDa
                specification |= iter->fSpecification;
                tmpChannelData = reinterpret_cast<AliHLTCaloChannelDataHeaderStruct*>(iter->fPtr);
 
                specification |= iter->fSpecification;
                tmpChannelData = reinterpret_cast<AliHLTCaloChannelDataHeaderStruct*>(iter->fPtr);
 
-               //HLTWarning (" channel number %d",tmpChannelData->fNChannels);
+               if (fBeVerbose)
+               HLTWarning ("I-RAWHISTOMAKERCOMPONENT: channel number %d",tmpChannelData->fNChannels);
 
 
-               ret = fRawHistoMakerPtr->MakeHisto(tmpChannelData, iter, outputPtr, size);
+               ret = fRawHistoMakerPtr->MakeHisto(tmpChannelData, iter, outputPtr, size, fBeVerbose);
 
                //if(ret == -1)
                //{
 
                //if(ret == -1)
                //{
@@ -151,14 +161,14 @@ AliHLTEMCALRawHistoMakerComponent::DoEvent(const AliHLTComponentEventData& evtDa
 
        fLocalEventCount++;
 
 
        fLocalEventCount++;
 
-       // fRawHistoMakerPtr->Reset();
-
        TFile rootHistFile(fRootFileName,"recreate");
 
        fRawHistoMakerPtr->GetHistograms()->Write();
 
        if (fLocalEventCount%fPushFraction == 0) {
        TFile rootHistFile(fRootFileName,"recreate");
 
        fRawHistoMakerPtr->GetHistograms()->Write();
 
        if (fLocalEventCount%fPushFraction == 0) {
-               cout << "pushback done at " << fLocalEventCount << " events " << endl;
+
+               if (fBeVerbose)
+                       cout << "I-RAWHISTOMAKERCOMPONENT: pushback done at " << fLocalEventCount << " events " << endl;
 
                PushBack(fRawHistoMakerPtr->GetHistograms(), kAliHLTDataTypeTObjArray | kAliHLTDataOriginEMCAL , specification);
        }
 
                PushBack(fRawHistoMakerPtr->GetHistograms(), kAliHLTDataTypeTObjArray | kAliHLTDataOriginEMCAL , specification);
        }
@@ -179,17 +189,18 @@ AliHLTEMCALRawHistoMakerComponent::DoInit(int argc, const char** argv )
        for(int i = 0; i < argc; i++)
        {
                if(!strcmp("-roothistofilename", argv[i]))
        for(int i = 0; i < argc; i++)
        {
                if(!strcmp("-roothistofilename", argv[i]))
-               {
                        fRootFileName = argv[i+1];
 
                        fRootFileName = argv[i+1];
 
-               }
                if(!strcmp("-pushfraction", argv[i]))
                if(!strcmp("-pushfraction", argv[i]))
-               {
                        fPushFraction = atoi(argv[i+1]);
                        fPushFraction = atoi(argv[i+1]);
-               }
+
+               if(!strcmp("-beverbose", argv[i]))
+                       fBeVerbose = atoi(argv[i+1]);
+
        }
 
        }
 
-       // cout << rootFileName << endl;
+       if (fBeVerbose)
+               cout << "I-RAWHISTOMAKERCOMPONENT: local root file name is: " << fRootFileName << endl;
 
        return 0;
 }
 
        return 0;
 }
index 281c1672878490adf2e1aaca9ba4af898d195225..e1bd102037f1454d2155679a692d44d08269af26 100644 (file)
@@ -86,6 +86,7 @@ private:
        TString fRootFileName;
        int fPushFraction;
        int fLocalEventCount;
        TString fRootFileName;
        int fPushFraction;
        int fLocalEventCount;
+       int fBeVerbose;
 
        /** Pointer to the histo maker itself */
        AliHLTEMCALRawHistoMaker *fRawHistoMakerPtr;                    //! transient
 
        /** Pointer to the histo maker itself */
        AliHLTEMCALRawHistoMaker *fRawHistoMakerPtr;                    //! transient