trying to get tpm1 vertex

From: Stephen J. Sanders (ssanders@ukans.edu)
Date: Thu Mar 29 2001 - 14:01:57 EST

  • Next message: Peter H. L. Christiansen: "Re: trying to get tpm1 vertex"

    Hi,  I have been trying to figure out how to get the tpm1 vertex out of
    Brat.  I got some instructions from
    Hiro which I'll send along with this message.  Before going into the
    details of what I did, the bottom line is that I'm getting an error:
    
    (Many of these Warning lines have been suppressed...)
    Warning in <BrTPCSequence::Compare>: this method must be overridden!
    Warning in <BrTPCSequence::Compare>: this method must be overridden!
    Warning in <BrTPCSequence::Compare>: this method must be overridden!
    Warning in <BrTPCSequence::Compare>: this method must be overridden!
    Warning in <BrTPCSequence::Compare>: this method must be overridden!
    Warning in <BrTPCSequence::Compare>: this method must be overridden!
    root.exe: BrTPCClusterFinder.cxx:409: Bool_t
    BrTPCClusterFinder::FindClusters(): Assertion `tabSeq' failed.
    
    This is found using  Brat 1.15.1 and Root 3.00.06.   I see the  same
    failure mode running on my linuxPPC system AND running on the RCF
    machines.  (Side note:  Why is root 3.00.06 not available on the rcf
    machines?, I had to compile it in my own directory.  The  1.15.1 version
    of Brat does not seem to compile with the earlier root systems...)
    
    Any suggestions would be greatly appreciated!
    (In the following, I used the .geo and .mag files from
    brahms_app/fv_app/Data)
    
                ...steve
    
    ---------------------------------------------------------------
    The Procedure that I followed is given in the note that Hiro sent me.
    The code follows his note...
    
            Ok.  Although I do not use it for my analysis, I played around
    the
    BRAT and got it working for using TPM1 Cluset vertex staff.  I attached
    the macro program (SiAnalyze8.C and Common.h), which use the TPM1 to
    find
    the vertex.  You also need 90deg.geo file in the directory where you are
    
    running this macro.  To run this macro, do the following
    
    1.  .L BratLoad and BratLoad()
            (if BratLoad() stops at BrAna, edit BratLoad.C such that
    "Ana" comes right before "EndList") (you do not need to do this if you
    run
    "bratroot" or something like that.)
    
    2.  .L Common.h
    3.  .L SiAnalyze8.C
    4.  Setup()
    5.  OpenRawFile()
            if you want to use this in your computer, edit my macro to open
    you file.
    6.  GetEvent();
    7.  Analyze();
            That is it.
    
    
    Now, you need to be carefull for using TPM1 Cluster vertex since you
    need
    to specify the cut.  You will accept TPM1 Vertex if the following
    condition is met.
            a.  z_error <1
            b.  z_sigma <2
            c.  abs(TPM1 Cluster Vertex - BB Vertex) < 10 cm
    
            Anyway, this should help you to get started.
    
            Hiro
    
    -------------------------------
    Common.h
    // Common.h
    // ========
    // Load this file with common symbols before
    // executing the other macros.
    // These objects are used across multiple macro routines.
    // This belongs to code that is meant to analyze a single TPC, and be
    able to
    // plot results.
    //
    BrGeantInput *geantinput;
    BrEvent      *geantevent;
    Bool_t       clear_gevent=kFALSE;
    //
    
    
    BrRawDataInput *InputFile;
    BrEventIO      *RootFile;
    BrEvent        *gevent;
    BrEvent        *digitized_node;
    BrEvent        *seq_node;
    BrRawDataInput *InputFile;
    Bool_t         clear_devent=kFALSE;
    Bool_t         clear_levent=kFALSE;
    BrEvent        *localtrack_node;
    BrModuleContainer *asp_digitize, *asp_localtrack;
    BrEventHeader  *event_header;
    
    
    //test
    BrDigSi *digsi_p;
    BrDigTiles *digtile_p;
    const Int_t NumCh = 58;
    
    
    Int_t EventNo;          // event number - set by reading routine
    
    
    --------------------------------------------------------------------
    SiAnalyze8.C
    
    
    void Setup(){
      //
      // Define modules, parameters to be used.
      //
      //  BrGeometryDbManager *gGeomDb = BrGeometryDbManager::Instance();
      //gGeomDb->SetDbFileName("test.geo");
    
      //BrParameterDbManager *gParamDb = BrParameterDbManager::Instance();
      //gParamDb->SetDbParameterFileName("DetectorParameters.txt");
    
      clear_devent= kFALSE;
      clear_levent= kFALSE;
      digitized_node=0;
    
    
    
    
    }
    //________________________________________________________________________
    
    
    
    void OpenRawFile()
    {
      InputFile = new BrRawDataInput("Test");
    
    if(InputFile->Open("/brahms/data01/data/raw/run002336seq000.dat","DISKFILE"))
    
        { cout << "File is opened. " << endl; }
      else
        { cout << "File is not opened. " << endl;}
    }
    
    //----------------------------------------------------------------------
    
    void GetEvent()
    {
      EventNo++;
      if (EventNo%100==0) cout << "Event No."<<EventNo<<endl;
      if(clear_devent)
        delete digitized_node;
      clear_devent=kTRUE;
    
      digitized_node = new BrEvent("Digitized Node",0, EventNo);
      InputFile->Event(digitized_node);
      //  cout << " Now list objects " << endl;
      //digitized_node->ListObjects();
      //  cout << " Objects have been listed!? " << endl;
    
    }
    //----------------------------------------------------------------
    
    
    //___________________________________________
    
    
    
    void Analyze()
    {
      Int_t i,j,k,m;
      //Int_t kNumMultSi=224;
      //Int_t MaxEventNum = 2;
      //const Int_t NumCh = 17; 16 ADC channel + 1 for event number
      //Float_t SiAdc[NumCh];
     // Create and init modules
      BrGeometryDbManager *gGeomDb = BrGeometryDbManager::Instance();
      gGeomDb->SetDbFileName("90deg.geo");
      gGeomDb->SetDbFileName("90deg.mag");
    
      BrParameterDbManager *gParamDb = BrParameterDbManager::Instance();
    
    gParamDb->SetDbParameterFileName("$BRATSYS/params/DetectorParameters.txt");
    
    
    
    
      preprocess = new BrTPCPreProcess("TPM1", "TPC Preprocessor");
      preprocess->Init();
    
      clusterfinder = new BrTPCClusterFinder("TPM1", "TPC clusterfinder");
      clusterfinder->Init();
      cout << "yep" << endl;
      vertexfinder = new BrTPMClusterVertexModule("cvtx","cvtx","TPM1");
      vertexfinder->Init();
    
      BrClonesArray *allhits;
      BrDataTable *datatable;
      float z, y, z_sigma, y_sigma, z_error, y_error;
      for (j=0; j<100000; j++)
      {
          GetEvent();
          datatable = digitized_node->GetDataTable("TPCSequence TPM1");
    
          vertex_node = new BrEventNode("vertex_node","vertex_node");
    
    
          preprocess->Event(digitized_node);
    
          clusterfinder->Event(digitized_node);
    
          allhits = clusterfinder->GetDetectorHits();
    
          // Find vertex
          vertexfinder->SetDetectorHits(allhits);
          vertexfinder->Event(digitized_node, vertex_node);
          if (cvtx = (BrVertex*)vertex_node->GetObject("TPM1 Cluster
    VtxData")) {
            if (cvtx->VertexFound()) {
              z = cvtx->GetZ();
              y = cvtx->GetY();
              cout << z << "  " << y << endl;
              z_sigma = cvtx->GetVertexZSigma();
              y_sigma = cvtx->GetVertexYSigma();
              z_error = sqrt(cvtx->GetVarianceZ());
              y_error = sqrt(cvtx->GetVarianceY());
              // SetValid();
            }
          }
          delete vertex_node;
      }
    
    }
    



    This archive was generated by hypermail 2b29 : Thu Mar 29 2001 - 14:03:03 EST