using namespace std;
#include "hhodopionmom.h"
#include "hododef.h"
#include "hhodohit.h"
#include "hhododetector.h"
#include "hdebug.h"
#include "hades.h"
#include "hiterator.h"
#include "hruntimedb.h"
#include "hspectrometer.h"
#include "hdetector.h"
#include "hevent.h"
#include "hcategory.h"
#include "hlinearcategory.h"
#include <iostream>
#include <iomanip>
#include <cstdlib>
HHodoPionMom::HHodoPionMom(void)
{
hitHodoCat=0;
iter=0;
}
HHodoPionMom::HHodoPionMom(const Text_t *name,const Text_t *title) : HReconstructor(name,title)
{
hitHodoCat=0;
iter=0;
}
HHodoPionMom::~HHodoPionMom(void)
{
}
Bool_t HHodoPionMom::init(void)
{
HHodoDetector *hodo;
hodo=(HHodoDetector *)gHades->getSetup()->getDetector("Hodo");
if(!hodo){
Error("init","No Hodo Det. found.");
return kFALSE;
}
hitHodoCat=hodo->buildCategory(catHodoHit);
if (!hitHodoCat) return kFALSE;
iter=(HIterator *)hitHodoCat->MakeIterator();
fActive=kTRUE;
return kTRUE;
}
Int_t HHodoPionMom::execute(void)
{
HHodoHit *pHodoHit=0;
iter->Reset();
Int_t mod=-1;
Int_t cnt1=0, cnt2=0;
Int_t strip1=-1, strip2=-1;
while ((pHodoHit=(HHodoHit *)iter->Next())!=0) {
Int_t st;
pHodoHit->getAddress(mod,st);
if (mod==usemod1 && st>=0){
strip1=st;
cnt1++;
}else if (mod==usemod2 && st>=0){
strip2=st;
cnt2++;
}
}
if (1==cnt1 && 1==cnt2){
Float_t Mittelwert;
Mittelwert = 0.5*(strip1+strip2);
Float_t Differenz;
Differenz = 0.5*(strip1 - strip2);
cout << "Mittelwert" << Mittelwert<< "Differenz"<<Differenz<<endl;
if (Mittelwert<mean_max && Mittelwert>mean_min && Differenz<diff_max && Differenz>diff_min){
return EXIT_SUCCESS;
}
}
return EXIT_FAILURE;
}
ClassImp(HHodoPionMom)
Last change: Sat May 22 12:57:34 2010
Last generated: 2010-05-22 12:57
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.