BRAT 2.4.5
Class index
Full class index
brahmlib
BRAHMS
ROOT page
//NOTE: USE AT YOUR OWN RISK KH 6-Aug-2002
//This is not operational yet.  It is just a placeholder revision with
//the Init method displaying my ideas.  It needs to be cleaned up 
//So don't use it unless you plan on doing some work to it.  That is the
//situation if this message is here.  I will remove the message as soon
//as I convince myself it is working.  Also, if you want to work on it,
//please contact me so that we don't duplicate efforts. KH

// $Id: BrRecoPackage.cxx,v 1.1 2002/08/06 22:12:47 hagel Exp $
// $Author: hagel $
// $Date: 2002/08/06 22:12:47 $
// $Copyright: (C) 2001 BRAHMS Collaboration <brahmlib@rhic.bnl.gov>
//
#include "BrRecoPackage.h"

#include "BrDbUpdateModule.h"
#include "BrTriggerFilter.h"
#include "BrHeaderModule.h"
#include "BrAppendContainer.h"
#include "BrCopyModule.h"
#include "BrDCTrackingModule.h"
#include "BrTpcTrackFollowModule.h"
#include "BrTpcCalModule.h"
#include "BrTpcTrackPackage.h"

#ifndef WIN32
#include <iostream>
#else
#include <iostream.h>
#endif

//____________________________________________________________________

ClassImp(BrRecoPackage);

//____________________________________________________________________
 BrRecoPackage::BrRecoPackage()
{
  // Default constructor. DO NOT USE
  SetState(kSetup);
}
//____________________________________________________________________
 BrRecoPackage::BrRecoPackage(const Char_t* name, const Char_t* title)
: BrModuleContainer(name, title)
{
  // Named Constructor
  SetState(kSetup);
}

//____________________________________________________________________
 void BrRecoPackage::Init()
{
  // This is where we add the tables deselected to the cleanupcontainer

  //
  //DBupdate...
  //

  BrDbUpdateModule *dbUpdate = new BrDbUpdateModule("update","update db");
  AddModule(dbUpdate);

  //__________________________________________________________________
  // Module: BrTriggerFilter
  BrTriggerFilter* triggerFilter = 
    new BrTriggerFilter("tFilter", "tFilter");
  AddModule(triggerFilter);
  triggerFilter->AddTrigger(1);
  triggerFilter->AddTrigger(2);
  triggerFilter->AddTrigger(3);
  triggerFilter->AddTrigger(4);
  triggerFilter->AddTrigger(5);
  triggerFilter->AddTrigger(6);
  triggerFilter->AddTrigger(8);

  //__________________________________________________________________
  // Module: BrHeaderModule
  BrHeaderModule* headerModule = 
    new BrHeaderModule("headerModule", "headerModule");
  AddModule(headerModule);  

  //CounterModule* counterModule = new CounterModule("counterModule",
  //					   "List event stat");
  //counterModule->SetFrequency(500);
  //mainModule->AddModule(counterModule); 

  BrAppendContainer* swModule = 
    new BrAppendContainer("Append","use out for both in/out");
  AddModule(swModule);


  // Module: BrCopyModule
  BrCopyModule* copyModule =
    new BrCopyModule("copy","copy");
  AddModule(copyModule);

  copyModule->AddObject("Global");
  copyModule->AddObject("TriggerScalers");
  copyModule->AddObject("DigTof TOFW");
  copyModule->AddObject("DigTof TOFWCAL");
  copyModule->AddObject("DigTof TMRS");
  copyModule->AddObject("DigTof TOF1");
  copyModule->AddObject("DigTof H1Cal");
  copyModule->AddObject("DigTof TD1");
  copyModule->AddObject("DigTof TOF2");
  copyModule->AddObject("DigTof TMrsB");
  copyModule->AddObject("DigTof TMrsF");
  copyModule->AddObject("DigC1");
  copyModule->AddObject("DigRICH");
  copyModule->AddObject("TpcFibDig T1F");
  copyModule->AddObject("TpcFibDig T2B");
  copyModule->AddObject("TpcFibDig TPM2F");
  copyModule->AddObject("TpcFibDig TPM2B");

  Int_t runNo = 0; //=runInfoManager->GetRunNo();
  //__________________________________________________________________
 
    Int_t CalibRunNo;
    Int_t ExtraOffset;
    Int_t GlobalTdcOffset=0;
    if(runNo<5200){
      ExtraOffset=0;
    }
    if(runNo >= 5200 && runNo < 5600){
      ExtraOffset=-375;
    }
    if(runNo >= 5600 && runNo < 5620){
      ExtraOffset=-507;
    }
    if(runNo >= 5620 && runNo < 6181){
      ExtraOffset=-522;
      GlobalTdcOffset = 8;
    }          
    if(runNo >= 6181){
      ExtraOffset=-522;
      GlobalTdcOffset = 0;
    }
    CalibRunNo = 6418;

   
  // The current DC params are from last part of HI run 
  
  BrDCTrackingModule* t3 = new BrDCTrackingModule("T3", "T3", kFALSE);
  t3->UseMySql();        //PS instructions 27-May-2002
  t3->SetMode(kRawData); //PS instructions 27-May-2002
  t3->SetCalibFile(Form("/brahms/u/videbaek/brahms_app/fv_app/calpar/T3CalibRun%d.dat",   CalibRunNo));
  t3->SetOffsetFile(Form("/brahms/u/videbaek/brahms_app/fv_app/calpar/T3OffsetRun%d.dat", CalibRunNo));
  t3->SetMinWidth(16);
  t3->SetHitNumberLimit(10, 1500);
  t3->SetVerbose(50);

  swModule->AddModule(t3);

  BrDCTrackingModule* t4 = new BrDCTrackingModule("T4", "T4",kFALSE); 
  t4->UseMySql();         //PS instructions 27-May-2002
  t4->SetMode(kRawData);  //PS instructions 27-May-2002
  t4->SetCalibFile(Form("/brahms/u/videbaek/brahms_app/fv_app/calpar/T4CalibRun%d.dat",CalibRunNo));
  t4->SetOffsetFile(Form("/brahms/u/videbaek/brahms_app/fv_app/calpar/T4OffsetRun%d.dat",CalibRunNo));
  t4->SetPromptDelay(4050+ExtraOffset);
  t4->SetHitNumberLimit(10, 1500);

  swModule->AddModule(t4);

  BrDCTrackingModule* t5 = new BrDCTrackingModule("T5", "T5",kFALSE);
  t5->UseMySql();         //PS instructions 27-May-2002
  t5->SetMode(kRawData);  //PS instructions 27-May-2002
  t5->SetCalibFile(Form("/brahms/u/videbaek/brahms_app/fv_app/calpar/T5CalibRun%d.dat",CalibRunNo));
  t5->SetOffsetFile(Form("/brahms/u/videbaek/brahms_app/fv_app/calpar/T5OffsetRun%d.dat",CalibRunNo));
  t5->SetPromptDelay(3850+ExtraOffset);
  t5->SetHitNumberLimit(6, 1500);
  
  swModule->AddModule(t5);

  //FS
  BrTpcHitPackage * t1TpcHitModule = new BrTpcHitPackage("T1","Clustering and Hits");
      
  swModule->AddModule(t1TpcHitModule);
  t1TpcHitModule->SetDebugLevel(0);
  
/*This should be done outside!!!  
  t1_param = (BrDetectorParamsTPC*)
      parameterManager->GetDetectorParameters("BrDetectorParamsTPC", "T1");
*/
    
  BrTpcSequencePPModule* t1_preprocess = t1TpcHitModule->GetTpcSequencePPModule();
  t1_preprocess->SetTimeCutLow(30);
  BrTpcTrackFollowModule* t1Tracker = 
      new BrTpcTrackFollowModule("T1", "Tracking Module");
  swModule->AddModule(t1Tracker);
    

/*This should be done outside!!!  
  t2_param = (BrDetectorParamsTPC*)
      parameterManager->GetDetectorParameters("BrDetectorParamsTPC", "T2");
*/

  BrTpcHitPackage * t2TpcHitModule = new BrTpcHitPackage("T2","Clustering and Hits");
  swModule->AddModule(t2TpcHitModule);
  t2TpcHitModule->SetDebugLevel(0);

  BrTpcTrackFollowModule* t2Tracker = 
      new BrTpcTrackFollowModule("T2", "Tracking Module");
  swModule->AddModule(t2Tracker);
    
/*This should be done outside!!!      
  t2_preprocess = t2TpcHitModule->GetTpcSequencePPModule();
  t2_preprocess->SetTimeCutLow(25);
  t2_preprocess->SetTimeCutHigh(150);
*/

  //________________________________________________________________________
  // Setup of special parameters for this run.
  //
/*This should be done outside!!!  
  tpm2_param = (BrDetectorParamsTPC*)
      parameterManager->GetDetectorParameters("BrDetectorParamsTPC", "TPM2");
  tpm1_param = (BrDetectorParamsTPC*)
      parameterManager->GetDetectorParameters("BrDetectorParamsTPC", "TPM1");

  if(runNo> 5276){
     // Disable rows 19-20 and enable rows 17-18 in BrDetectorParamsTPC.
     // The FEE cards on TPM2 were swapped on Oct-11-2001. Last data run
     // before swapping was 5276.
     tpm2_param->SetRowActive(17);
     tpm2_param->SetRowActive(18);
     tpm2_param->SetRowInActive(19);
     tpm2_param->SetRowInActive(20);
     tpm2_param->SetRowInActive(1);
     }
  else {
     tpm2_param->SetRowInActive(20);
     }
  tpm2_param->SetRowInActive(1);

  // Bad pads
  //
  tpm2_param->SetDeadPad(11, 40, 47);
  tpm2_param->SetDeadPad(12, 40, 47);
  tpm2_param->SetDeadPad(1,  96, 103);
  tpm2_param->SetDeadPad(2,  96, 103);
    
  //Uninstrumented Pads
  //
  tpm2_param->SetDeadPad(1,112,143);
  tpm2_param->SetDeadPad(2,112,143);
  tpm2_param->SetDeadPad(1,0,31);
  tpm2_param->SetDeadPad(2,0,31);

  tpm2_param->SetDeadPad(5,0,31);
  tpm2_param->SetDeadPad(6,0,31);
  tpm2_param->SetDeadPad(5,112,143);
  tpm2_param->SetDeadPad(6,112,143);
    
  tpm2_param->SetDeadPad(11,128,143);
  tpm2_param->SetDeadPad(12,128,143);

  t1_param->SetDeadPad(1,0,0);
  t1_param->SetDeadPad(2,0,0);
  t1_param->SetDeadPad(3,0,0);
  t1_param->SetDeadPad(4,0,0);
  t1_param->SetDeadPad(7,0,0);
  t1_param->SetDeadPad(7,94,95);
  t1_param->SetDeadPad(8,0,0);
  t1_param->SetDeadPad(8,94,95);
  t1_param->SetDeadPad(11,0,0);
  t1_param->SetDeadPad(11,94,95);
  t1_param->SetDeadPad(12,0,0);
  t1_param->SetDeadPad(12,94,95);
  t1_param->SetDeadPad(13,0,0);
  t1_param->SetDeadPad(13,94,95);
  t1_param->SetDeadPad(14,0,0);
  t1_param->SetDeadPad(14,94,95);

  t2_param->SetDriftVelocity(0.0019);
*/
  //Begin copy from DO

  // Now add the TPC tracking modules to the pipeline
  // We use the default parameters for most Tpcs
  // The calibration data are also loaded here if available


    
  //Char_t *tpcNames[4] = {"TPM1", "TPM2", "T1", "T2"};
  Char_t *tpcNames[2] = {"TPM1", "TPM2"};
  
  //for(Int_t i = 0; i < 4; i++) {
  for(Int_t i = 0; i < 2; i++) {
    
     // If there are valid tpc calibrations in the database
     // uncomment the following lines
     //
     BrTpcCalModule *tpcModule = 
      new BrTpcCalModule(tpcNames[i], "Tpc apply calibration module");
     
     //Only tpm1 has no time offsets
     //if (i == 0)
     tpcModule->SetUseTimeOffsets(kFALSE);
     //if(i<=1)
     //tpcModule->SetUseDriftVelocity(kFALSE);
     tpcModule->SetUseDriftVelocity(kTRUE);
     //if(i>1)
     //tpcModule->SetUseDriftVelocity(kFALSE);
     AddModule(tpcModule);
     
     BrTpcTrackPackage* trackPackage = 
        new BrTpcTrackPackage(tpcNames[i], "tracking Module");
    
     //For the forward spectrometer where there are few rows we 
     //want to have hits in many rows

     if (i > 1) {
        BrTpcTrackFollowModule* trackModule = 
	   (BrTpcTrackFollowModule*)trackPackage->GetTpcTrackModule();
        trackModule->SetMaxRowsMissed(2);
        }
    
     AddModule(trackPackage);
     }

}

//____________________________________________________________________
 void BrRecoPackage::Print(Option_t* option) const
{
  // Print module information
  // See BrModule::Print for options.
  // In addition this module defines the Option:

  TString opt(option);
  opt.ToLower(); 
  
  if (opt.Contains("d")) 
   cout << endl 
         << "  Original author: K. Hagel" << endl
         << "  Last Modifications: " << endl 
         << "    $Author: hagel $" << endl  
         << "    $Date: 2002/08/06 22:12:47 $"   << endl 
         << "    $Revision: 1.1 $ " << endl  
         << endl 
         << "-------------------------------------------------" << endl;
}

//____________________________________________________________________
//
// $Log: BrRecoPackage.cxx,v $
// Revision 1.1  2002/08/06 22:12:47  hagel
// Initial placeholder revision
//

This page automatically generated by script docBrat by Christian Holm

Copyright ; 2002 BRAHMS Collaboration <brahmlib@rcf.rhic.bnl.gov>
Last Update on by

Validate HTML
Validate CSS