Locked History Actions

attachment:ICBHist.C of ANAROOT/Macros

Attachment 'ICBHist.C'

Download

// Example for SAMURAI ICB
// NOTICE!: software threshold 200ch is set in TArtCalibIC.cc (anaroot_v4.5.4)

void ICBHist(){

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

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

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

  // TArtCalibHODPla is a class for calibartion of SAMURAI Hodoscope
  TArtCalibIC *calibic = new TArtCalibIC;

  // define histograms
  TH1* hid = new TH1I("hid", "ICB ID", 10, 0.5, 10.5);
  TH1* ha  = new TH2D("ha", "ICB ID-ARaw", 10,0.5,10.5, 4100, 0, 4100);
  TH1* he  = new TH1D("he", "ICB E", 500, 0, 50);

  // event loop
  int nevent = 0;
  while(eventstore->GetNextEvent() && nevent<10000){
    calibic->ReconstructData();

    // Get calibrated data
    TClonesArray * ic_array = 
      (TClonesArray *)sman->FindDataContainer("BigRIPSIC");
    // another way
    //TClonesArray *ic_array = (TClonesArray*)calibic->GetICArray();

    TArtIC *icb = (TArtIC *)TArtUtil::FindDataObject(ic_array,(char*)"ICB");

    if (icb!=0){
      Int_t nhit = icb->GetNumHit();
      for(Int_t i=0; i<nhit; i++){
        hid->Fill(i);
        ha->Fill( i, icb->GetRawADC(i) );
      }
      he->Fill( icb->GetEnergySqSum() );
    }

    // clear
    calibic->ClearData();
    eventstore->ClearData();
    ++nevent;
  }

  return;
}

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.