]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/PHOS/AliHLTPHOSTreeMakerComponent.cxx
New component for writing calibration data to fxs (Oystein)
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSTreeMakerComponent.cxx
index 7be3fea00de438cc9fcfd96d64d617552225bc81..1abbf6b4f2ba78dbb4e1285f73e71095c16913f4 100644 (file)
@@ -37,15 +37,18 @@ AliHLTPHOSTreeMakerComponent::AliHLTPHOSTreeMakerComponent() :
   fEventCount(0),
   fWriteInterval(1000)
 {
+  //comment
 }
 
 AliHLTPHOSTreeMakerComponent::~AliHLTPHOSTreeMakerComponent()
 {
+  //comment
 }
 
 int 
 AliHLTPHOSTreeMakerComponent::Deinit()
 {
+  //comment
   cout << "Printing file...";
   char filename [50];
   sprintf(filename, "%s/run%d_digitTree_%d.root", fDirectory, fRunNb,(fEventCount/fWriteInterval));
@@ -67,12 +70,14 @@ AliHLTPHOSTreeMakerComponent::Deinit()
 const char*
 AliHLTPHOSTreeMakerComponent::GetComponentID()
 {
+  //comment
   return "PhosTreeMaker";
 }
 
 void
 AliHLTPHOSTreeMakerComponent::GetInputDataTypes(vector<AliHLTComponentDataType>& list)
 { 
+  //comment
  //Get datatypes for input
   const AliHLTComponentDataType* pType=fgkInputDataTypes;
   while (pType->fID!=0) {
@@ -84,20 +89,22 @@ AliHLTPHOSTreeMakerComponent::GetInputDataTypes(vector<AliHLTComponentDataType>&
 AliHLTComponentDataType 
 AliHLTPHOSTreeMakerComponent::GetOutputDataType()
 {
+  //comment
   return AliHLTPHOSDefinitions::fgkAliHLTRootTreeDataType;
 }
 
 void 
 AliHLTPHOSTreeMakerComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier)
 {
+  //comment
   constBase = 30;
   inputMultiplier = 1;
 }
 
 int 
 AliHLTPHOSTreeMakerComponent::DoEvent(const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
-                                       AliHLTComponentTriggerData& /*trigData*/, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size,
-                                       std::vector<AliHLTComponentBlockData>& outputBlocks)
+                                       AliHLTComponentTriggerData& /*trigData*/, AliHLTUInt8_t* /*outputPtr*/, AliHLTUInt32_t& /*size*/,  //TODO: I think size should be set to zero when returning from this method if not data was written to the output buffer.
+                                       std::vector<AliHLTComponentBlockData>& /*outputBlocks*/)
 
 {
   //Do event
@@ -116,7 +123,7 @@ AliHLTPHOSTreeMakerComponent::DoEvent(const AliHLTComponentEventData& evtData, c
       if ( iter->fDataType == AliHLTPHOSDefinitions::fgkAliHLTDigitDataType )
 
         {
-          digitEvent == true;
+          digitEvent = true;
           nDigits  = fTreeMakerPtr->MakeDigitArray ( reinterpret_cast<AliHLTPHOSDigitContainerDataStruct*> ( iter->fPtr ), totalDigits );
           totalDigits += nDigits;
          //cout << totalDigits << endl;
@@ -143,7 +150,7 @@ return 0;
 int
 AliHLTPHOSTreeMakerComponent::DoInit ( int argc, const char** argv )
 {
-
+  //comment
   fTreeMakerPtr = new AliHLTPHOSTreeMaker();
   fDigitTreePtr = new TTree ( "digitTree", "Digits tree" );
   fDirectory = new char[50];
@@ -163,7 +170,7 @@ AliHLTPHOSTreeMakerComponent::DoInit ( int argc, const char** argv )
   fTreeMakerPtr->SetDigitTree(fDigitTreePtr);
     
   fstream runNbFile;
-  Int_t newRunNb;
+  //Int_t newRunNb;
   runNbFile.open("/opt/HLT-public/rundir/runNumber.txt");
   runNbFile >> fRunNb;
   runNbFile.close();
@@ -182,14 +189,16 @@ AliHLTPHOSTreeMakerComponent::DoInit ( int argc, const char** argv )
 AliHLTComponent*
 AliHLTPHOSTreeMakerComponent::Spawn()
 {
+  //comment
   return new AliHLTPHOSTreeMakerComponent();
 }
 
 void
 AliHLTPHOSTreeMakerComponent::Write()
 {
+  //comment
   cout << "Writing file...";
-  char filename [50];
+  char filename [256];
   sprintf(filename, "%s/run%d_digitTree_%d.root", fDirectory, fRunNb,(fEventCount/fWriteInterval - 1));
   TFile *outfile = new TFile(filename,"recreate");
   fDigitTreePtr->Write();
@@ -201,6 +210,7 @@ AliHLTPHOSTreeMakerComponent::Write()
 void
 AliHLTPHOSTreeMakerComponent::ResetTrees()
 {
+  //comment
   delete fDigitTreePtr;
   fDigitTreePtr = new TTree("digitTree", "Digits tree");
   fTreeMakerPtr->SetDigitTree(fDigitTreePtr);