Message: RE: add ntuple variable in AIDA Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None RE: add ntuple variable in AIDA 

Forum: Analysis
Re: None add ntuple variable in AIDA (Steven Avery)
Date: 18 Sep, 2003
From: <tony_johnson@SLAC.Stanford.EDU>

> How do you add de/dx to the list of ntuple variables. i'm 
> tyring to look at the energy loss of protons in water, but i 
> don't know how to pull out de/dx after it is calculated.

The Geant4 example/extended/analysis/A01 shows how to create and fill AIDA n-tuples. For example in A01EventAction.cc:

  // Create a Tuple

  ITupleFactory* tFactory = analysisManager->getTupleFactory();
  if (tFactory)
  {
     tuple = tFactory->create("MyTuple","MyTuple","int dc1Hits, dc2Hits, double ECEnergy, HCEnergy, time1, time2","");
  }

...

  // Fill the tuple

  if (tuple)
  {
	if (DHC1) tuple->fill(0,DHC1->entries());
	if (DHC2) tuple->fill(1,DHC2->entries());
	if(ECHC)
    {
      int iHit = 0;
      double totalE = 0.;
      for(int i1=0;i1<80;i1++)
      {
        A01EmCalorimeterHit* aHit = (*ECHC)[i1];
        double eDep = aHit->GetEdep();
        if(eDep>0.)
        {
          iHit++;
          totalE += eDep;
        }
      }
      tuple->fill(2,totalE);

	  if (HHC1 && HHC2 && HHC1->entries()==1 && HHC2->entries()==1)
	  {
	     double tof = (*HHC2)[0]->GetTime() - (*HHC1)[0]->GetTime();
		 if (evstof) evstof->fill(tof,totalE);
	  }
    }
    if(HCHC)
    {
      int iHit = 0;
      double totalE = 0.;
      for(int i1=0;i1<20;i1++)
      {
        A01HadCalorimeterHit* aHit = (*HCHC)[i1];
        double eDep = aHit->GetEdep();
        if(eDep>0.)
        {
          iHit++;
          totalE += eDep;
        }
      }
      tuple->fill(3,totalE);
    }
	if (HHC1 && HHC1->entries()==1) tuple->fill(4,(*HHC1)[0]->GetTime());
	if (HHC2 && HHC2->entries()==1) tuple->fill(5,(*HHC2)[0]->GetTime());
	tuple->addRow();
  }

Hope that helps.

Tony

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

 Add Message Add Message
to: "RE: add ntuple variable in AIDA"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]