]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/MUON/OnlineAnalysis/AliHLTMUONHitReconstructorComponent.cxx
Merge remote-tracking branch 'origin/flatdev' into mergeFlat2Master
[u/mrichter/AliRoot.git] / HLT / MUON / OnlineAnalysis / AliHLTMUONHitReconstructorComponent.cxx
index a6ec61784ccf4d93134f1e8229cd5ac2c45cc3ca..eea01bd7c80a12c30d5fa8e15f875acdb7b398eb 100644 (file)
@@ -40,6 +40,7 @@
 #include "AliHLTLogging.h"
 #include "AliHLTSystem.h"
 #include "AliHLTDefinitions.h"
+#include "AliHLTCDHWrapper.h"
 #include <cstdlib>
 #include <cerrno>
 #include <cassert>
@@ -511,6 +512,8 @@ int AliHLTMUONHitReconstructorComponent::DoInit(int argc, const char** argv)
        fHitRec->GenerateClusterInfo(makeClusters);
        fHitRec->GenerateChannelInfo(makeChannels);
        fHitRec->DDLNumber(fDDL);
+       //The DDL number has to be set before the following InitDetElemInDDLArray() method
+       fHitRec->InitDetElemInDDLArray();
        HLTDebug("dHLT hit reconstruction component is initialized.");
        return 0;
 }
@@ -521,7 +524,7 @@ int AliHLTMUONHitReconstructorComponent::DoDeinit()
        ///
        /// Inherited from AliHLTComponent. Performs a cleanup of the component.
        ///
-       
+       fHitRec->DeInitDetElemInDDLArray();
        HLTInfo("Deinitialising dHLT hit reconstruction component.");
        FreeMemory();
        return 0;
@@ -540,8 +543,9 @@ int AliHLTMUONHitReconstructorComponent::Reconfigure(
        ///      cut parameter if 'cdbEntry' equals "HLT/ConfigMUON/HitReconstructor".
        /// \param componentId  The name of the component in the current chain.
        
-       bool startsWithMUON = TString(cdbEntry).Index("MUON/", 5, 0, TString::kExact) == 0;
-       bool givenConfigPath = strcmp(cdbEntry, AliHLTMUONConstants::HitReconstructorCDBPath()) == 0;
+       TString path = cdbEntry;
+       bool startsWithMUON = path.Index("MUON/", 5, 0, TString::kExact) == 0;
+       bool givenConfigPath = (path == AliHLTMUONConstants::HitReconstructorCDBPath());
        
        if (cdbEntry == NULL or startsWithMUON or givenConfigPath)
        {
@@ -738,10 +742,14 @@ int AliHLTMUONHitReconstructorComponent::DoEvent(
                        break;
                }
                
+           AliHLTCDHWrapper cdh(blocks[n].fPtr);
+
+               AliHLTUInt32_t headerSize = cdh.GetHeaderSize();
+
                AliHLTUInt32_t totalDDLSize = blocks[n].fSize / sizeof(AliHLTUInt32_t);
-               AliHLTUInt32_t ddlRawDataSize = totalDDLSize - fHitRec->GetkDDLHeaderSize();
+               AliHLTUInt32_t ddlRawDataSize = totalDDLSize - headerSize / sizeof(AliHLTUInt32_t);
                AliHLTUInt32_t* buffer = reinterpret_cast<AliHLTUInt32_t*>(blocks[n].fPtr)
-                       + fHitRec->GetkDDLHeaderSize();
+    + headerSize/sizeof(AliHLTUInt32_t);
                AliHLTUInt32_t nofHit = block.MaxNumberOfEntries();
 
 #ifdef DEBUG
@@ -977,7 +985,7 @@ int AliHLTMUONHitReconstructorComponent::ReadLookUpTable(const char* lutFileName
                }
                
                int result = sscanf(
-                       str.c_str(), "%d\t%d\t%d\t%d\t%e\t%e\t%e\t%e\t%d\t%e\t%e\t%e\t%e\t%d\t%d",
+                       str.c_str(), "%14d\t%14d\t%14d\t%14d\t%23e\t%23e\t%23e\t%23e\t%14d\t%23e\t%23e\t%23e\t%23e\t%14d\t%14d",
                        &idManuChannel, &fLut[i].fDetElemId, &fLut[i].fIX,
                        &fLut[i].fIY, &fLut[i].fRealX,
                        &fLut[i].fRealY, &fLut[i].fRealZ,
@@ -998,11 +1006,10 @@ int AliHLTMUONHitReconstructorComponent::ReadLookUpTable(const char* lutFileName
        }
 
        MaxEntryPerBusPatch::iterator it;
-       for(it=fMaxEntryPerBusPatch.begin();it!=fMaxEntryPerBusPatch.end();it++){
-         HLTDebug("fMaxEntryPerBusPatch[%d] : %d",it->first,it->second);
-         fMaxEntryPerBusPatch[it->first] = AliHLTInt32_t(0.05*(it->second));///< for 10% occupancy 
-         HLTDebug("fMaxEntryPerBusPatch[%d] : %d",it->first,it->second);
-         
+       for(it=fMaxEntryPerBusPatch.begin(); it!=fMaxEntryPerBusPatch.end(); it++){
+               HLTDebug("fMaxEntryPerBusPatch[%d] : %d",it->first,it->second);
+               fMaxEntryPerBusPatch[it->first] = AliHLTInt32_t(0.05*(it->second));///< for 10% occupancy 
+               HLTDebug("fMaxEntryPerBusPatch[%d] : %d",it->first,it->second);
        }
        
        return 0;
@@ -1054,7 +1061,7 @@ int AliHLTMUONHitReconstructorComponent::ReadLutFromCDB()
                HLTError("Failed to load geomerty data.");
                return -ENOENT;
        }
-       
+
        AliMUONCalibrationData calibData(AliCDBManager::Instance()->GetRun());
        
        bool skippedPads = false;
@@ -1088,6 +1095,7 @@ int AliHLTMUONHitReconstructorComponent::ReadLutFromCDB()
                                Int_t idManuChannel, manuId, channelId, buspatchId;
                                AliHLTFloat32_t padSizeX, padSizeY;
                                AliHLTFloat32_t halfPadSize;
+                               AliHLTFloat32_t padSizeXY;
                                Double_t realX, realY, realZ;
                                Double_t localX, localY, localZ;
                                Float_t calibA0Coeff,calibA1Coeff,pedestal,sigma;
@@ -1194,11 +1202,15 @@ int AliHLTMUONHitReconstructorComponent::ReadLutFromCDB()
                                                continue;
                                        }
                                        
-                                       if (plane == 0)
+
+                                       if (plane == 0){
                                                halfPadSize = padSizeX;
-                                       else
+                                               padSizeXY = padSizeY;
+                                       }else{
                                                halfPadSize = padSizeY;
-                                       
+                                               padSizeXY = padSizeX;
+                                       }
+
                                        fIdToEntry[idManuChannel] = iEntry+1;
                                        fMaxEntryPerBusPatch[buspatchId] = fMaxEntryPerBusPatch[buspatchId] + 1;  
                                        
@@ -1209,6 +1221,7 @@ int AliHLTMUONHitReconstructorComponent::ReadLutFromCDB()
                                        lut.fRealY = realY;
                                        lut.fRealZ = realZ;
                                        lut.fHalfPadSize = halfPadSize;
+                                       lut.fPadSizeXY = padSizeXY;
                                        lut.fPlane = plane;
                                        lut.fPed = pedestal;
                                        lut.fSigma = sigma;
@@ -1259,6 +1272,7 @@ int AliHLTMUONHitReconstructorComponent::ReadLutFromCDB()
        fLut[0].fRealY = 0.0;
        fLut[0].fRealZ = 0.0;
        fLut[0].fHalfPadSize = 0.0;
+       fLut[0].fPadSizeXY = 0.0;
        fLut[0].fPlane = -1;
        fLut[0].fPed = -1;
        fLut[0].fSigma = -1;
@@ -1272,10 +1286,10 @@ int AliHLTMUONHitReconstructorComponent::ReadLutFromCDB()
        lutList.clear();
 
        MaxEntryPerBusPatch::iterator it;
-       for(it=fMaxEntryPerBusPatch.begin();it!=fMaxEntryPerBusPatch.end();it++){
-         HLTDebug("fMaxEntryPerBusPatch[%d] : %d",it->first,it->second);
-         fMaxEntryPerBusPatch[it->first] = AliHLTInt32_t(0.05*(it->second));///< for 10% occupancy 
-         HLTDebug("fMaxEntryPerBusPatch[%d] : %d",it->first,it->second);
+       for(it=fMaxEntryPerBusPatch.begin(); it!=fMaxEntryPerBusPatch.end(); it++){
+               HLTDebug("fMaxEntryPerBusPatch[%d] : %d",it->first,it->second);
+               fMaxEntryPerBusPatch[it->first] = AliHLTInt32_t(0.05*(it->second));///< for 10% occupancy
+               HLTDebug("fMaxEntryPerBusPatch[%d] : %d",it->first,it->second);
        }
 
        return 0;