--- calo/flight/CaloPreSampler/src/CaloPreSampler.cpp 2009/02/24 09:18:05 1.12 +++ calo/flight/CaloPreSampler/src/CaloPreSampler.cpp 2010/03/10 12:11:11 1.17 @@ -14,6 +14,11 @@ Clear(); } +void CaloPreSampler::SetCaloLevel2Pointer(CaloLevel2 *cl2p){ + if ( pcalo ) delete pcalo; + pcalo = cl2p; +} + CaloPreSampler::CaloPreSampler(PamLevel2 *l2p){ // L2 = l2p; @@ -36,12 +41,14 @@ sel = true; cont = false; emulate18 = true; + usepl18x = false; simulation = false; withtrk = true; rigdefault = 50.; nox = false; noy = false; forcecalo = false; + forcefitmode = -1; memset(mask,0,2*22*sizeof(Int_t)); // Clear(); @@ -71,6 +78,15 @@ // } +CaloTrkVar* CaloPreSampler::GetCaloTrack(Int_t t){ + this->Process(); + if ( t < 0 ) return pcalo->GetCaloStoredTrack(t); + if ( L2->GetTrack(t) ){ + return pcalo->GetCaloStoredTrack(L2->GetTrack(t)->GetTrkTrack()->GetSeqNo()); + }; + return NULL; +} + void CaloPreSampler::SetNoWpreSampler(Int_t n){ if ( NC+n < 23 ){ N = n; @@ -153,10 +169,20 @@ // 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() ){ + if ( debug ) printf(" I am here, we have orbital infos \n"); if ( L2->GetOrbitalInfo()->pkt_num != PKT || L2->GetOrbitalInfo()->OBT != OBT || L2->GetOrbitalInfo()->absTime != atime || sel != ssel ){ newentry = true; OBT = L2->GetOrbitalInfo()->OBT; @@ -215,6 +241,8 @@ // mip = L2->GetCaloLevel1()->DecodeEstrip(i,view,plane,strip); // + if ( !usepl18x && view==0 && plane==18 ) mip = 0.; + // // Mask x or y view if nox and/or noy are true (default false) // if ( mask[view][plane] ) mip = 0.;