--- calo/flight/CaloPreSampler/src/CaloPreSampler.cpp 2008/05/28 08:31:46 1.10 +++ calo/flight/CaloPreSampler/src/CaloPreSampler.cpp 2009/07/27 13:58:58 1.13 @@ -42,6 +42,7 @@ nox = false; noy = false; forcecalo = false; + forcefitmode = -1; memset(mask,0,2*22*sizeof(Int_t)); // Clear(); @@ -95,6 +96,18 @@ }; } +void CaloPreSampler::SplitInto(Int_t NoWpreSampler, Int_t NoWcalo){ + this->SetNoWcalo(0); + this->SetNoWpreSampler(0); + if ( NoWpreSampler < NoWcalo ){ + this->SetNoWpreSampler(NoWpreSampler); + this->SetNoWcalo(NoWcalo); + } else { + this->SetNoWcalo(NoWcalo); + this->SetNoWpreSampler(NoWpreSampler); + }; +} + void CaloPreSampler::Clear(){ // pcalo->Clear(); @@ -138,6 +151,19 @@ return; }; // + // Clear structures used to communicate with fortran + // + event->ClearStructs();//ELENA + if ( forcefitmode > 0 ){ + if ( forcefitmode != 1000 && forcefitmode != 1001 && forcefitmode != 1002 ){ + printf(" ERROR! forcefitmode=%i \n Use forcefitmode = 1000 for fit mode 0, 1001 fit mode 1, 1002 fit mode 3\n",forcefitmode); + forcefitmode = -1; + } else { + event->clevel2->fmode[0] = forcefitmode; + event->clevel2->fmode[1] = forcefitmode; + }; + }; + // Bool_t newentry = false; // if ( L2->IsORB() ){ @@ -494,10 +520,11 @@ if ( debug ) printf(" Selftrigger: problems with event \n"); }; }; - // - // Clear structures used to communicate with fortran - // - event->ClearStructs(); +// // +// // Clear structures used to communicate with fortran +// // +// event->ClearStructs(); +// ELENA: moved @ beginning // // // @@ -505,3 +532,50 @@ if ( debug ) printf(" exit \n"); // } + +// +// Method to add a calorimeter track, evaluated around a tracker track defined by a status vector. +// (can be used to evaluate the calorimeter track around an arbitrary axis, by setting the status vector with zero deflection ) +// +// +CaloTrkVar* CaloPreSampler::AddCaloTrkVar(float *al,int trktag){ + + int ntrkentry = pcalo->ntrk(); + // + for (Int_t nt=0; nt < ntrkentry; nt++){ + if( pcalo->GetCaloTrkVar(nt)->trkseqno == trktag){ + cout << " CaloTrkVar* CaloPreSampler::AddCaloTrkVar(float *al,int trktag)"< trktag = "<clevel1->good2 = 1; //is a trk track + event->clevel1->trkchi2 = 0; + event->clevel1->hzn = 0; + // + // Copy the alpha vector in the input structure + // + for (Int_t e = 0; e < 5 ; e++){ + event->clevel1->al_p[e][0] = al[e]; + }; + // + // Get tracker related variables for this track + // + if ( debug ) printf("track %i Call GetTrkVar() \n",trktag); + event->GetTrkVar(); + if ( debug ) printf(" event->clevel2->dX0l %f \n",event->clevel2->dX0l); + // + // Save tracker track sequence number + // + event->trkseqno = trktag; + // + // Copy values in the class ca from the structure clevel2 + // + if ( debug ) printf("track %i Call FillTrkVar() \n",trktag); + event->FillTrkVar(pcalo,ntrkentry); + + return pcalo->GetCaloTrkVar(ntrkentry); + + +};//ELENA