Locked History Actions

attachment:PlaHist.C of ANAROOT/Macros

Attachment 'PlaHist.C'

Download

void PlaHist(){

  // set raw data file
  TArtEventStore *estore = new TArtEventStore;
  const char* filename = "ridf/sdaq02/dayone0080.ridf";//22C+C run
  if(!estore->Open(filename)){
    std::cout << "cannot open " << filename << std::endl;
    return;
  }

  // calibration parameters
  TArtBigRIPSParameters *para = TArtBigRIPSParameters::Instance();
  para->LoadParameter("db/BigRIPSPlastic.xml");

  // TArtStoreManager is a class for accessing calibrated data
  TArtStoreManager *sman = TArtStoreManager::Instance();

  // define histograms
  TH1 *hf7plat = new TH1D("hf7plat","F7Pla T",4000,0,4000);
  TH1 *hf7plaq = new TH1D("hf7plaq","F7Pla Q",500,0,500);
  TH2 *hf7pla  = new TH2D("hf7pla","F7Pla T Q",200,0,4000, 200,0,500);

  // calibration class
  TArtCalibPlastic *calib_pla = new TArtCalibPlastic;


  int neve = 0;
  while(estore->GetNextEvent() && neve<10000){
    if(neve%1000==0) cout << "event: " << neve << endl;
    calib_pla->ReconstructData();

    TClonesArray * pla_array = 
      (TClonesArray *)sman->FindDataContainer("BigRIPSPlastic");

    if ( 0 != pla_array ){
      TArtPlastic * pla = (TArtPlastic *)TArtUtil::FindDataObject(pla_array,(char*)"F7pl");
      Double_t f7plat, f7plaq;
      if(pla){
        if(pla->GetTLRaw() > 0 && pla->GetTRRaw() > 0){
          f7plat = ((Double_t)pla->GetTLRaw() + (Double_t)pla->GetTRRaw())/2;
          hf7plat->Fill(f7plat);
        }      
        if(pla->GetQLRaw() > 0 && pla->GetQRRaw() > 0){
          f7plaq = pla->GetQAveRaw();
          hf7plaq->Fill(f7plaq);
        }
        if (f7plat>0 && f7plaq>0)
          hf7pla->Fill(f7plat,f7plaq);
        
      }
    }
    //------------------------------------------------
    calib_pla->ClearData();
    estore->ClearData();
    ++neve;
    //------------------------------------------------
  }

}

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2012-11-02 05:21:15, 1.6 KB) [[attachment:BPCHist.C]]
  • [get | view] (2013-02-27 09:18:59, 0.8 KB) [[attachment:CoinHist.C]]
  • [get | view] (2012-11-02 05:10:49, 2.6 KB) [[attachment:FDC2Hist.C]]
  • [get | view] (2012-11-02 04:31:49, 2.1 KB) [[attachment:HODHist.C]]
  • [get | view] (2012-11-02 04:31:32, 1.6 KB) [[attachment:ICBHist.C]]
  • [get | view] (2014-12-31 11:41:13, 19.5 KB) [[attachment:OnlineMonitor.cc]]
  • [get | view] (2014-12-31 11:41:02, 2.6 KB) [[attachment:OnlineMonitor.hh]]
  • [get | view] (2012-11-02 05:25:41, 1.7 KB) [[attachment:PlaHist.C]]
  • [get | view] (2012-02-15 09:14:24, 3.2 KB) [[attachment:ch2ns.C]]
  • [get | view] (2012-02-15 10:05:13, 3.0 KB) [[attachment:getlandaupeak.C]]
  • [get | view] (2012-02-15 09:14:53, 2.7 KB) [[attachment:getped.C]]
  • [get | view] (2012-02-13 09:49:04, 2.6 KB) [[attachment:makevsta.C]]
  • [get | view] (2012-02-19 14:44:04, 0.5 KB) [[attachment:slew.C]]

You are not allowed to attach a file to this page.