BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
slope.cxx File Reference

Go to the source code of this file.

Functions

void slope ()
 

Variables

const double k_high = 0.0
 
const double k_low = 0.0
 
const double b = 1.0
 
const bool b_trunc = true
 

Function Documentation

◆ slope()

void slope ( )

Definition at line 12 of file slope.cxx.

13{
14 TFile *f=new TFile("eangle.root");
15 ostringstream strout;
16 strout<<"ddgcalib";
17 TTree *tree = f->Get(strout.str().c_str());
18 double dedx[100],eangle[100], fitmean[100], fitmeanerr[100];
19 double pos_fitmean[100], pos_fitmeanerr[100], neg_fitmean[100], neg_fitmeanerr[100];
20 // tree->SetBranchAddress("gain",dedx);
21 if(b_trunc) tree->SetBranchAddress("truncgain",dedx);
22 else tree->SetBranchAddress("gain",dedx);
23 tree->SetBranchAddress("eangle",eangle);
24 tree->SetBranchAddress("fitmean",fitmean);
25 tree->SetBranchAddress("fitmeanerr",fitmeanerr);
26 tree->SetBranchAddress("pos_fitmean",pos_fitmean);
27 tree->SetBranchAddress("pos_fitmeanerr",pos_fitmeanerr);
28 tree->SetBranchAddress("neg_fitmean",neg_fitmean);
29 tree->SetBranchAddress("neg_fitmeanerr",neg_fitmeanerr);
30
31 cout<<"Entries: "<<tree->GetEntries()<<endl;
32 tree->GetEntry(0);
33
34 int entry[1] = {100};
35 double denangle[100];
36 // for(int i=0; i<100; i++) denangle[i] = (dedx[i])*(k*(eangle[i])+b); // correct by a slope
37 // next we try sub-region correction with a slope
38 for(int i=0; i<100; i++){
39 if(fabs(eangle[i])<=0.04) denangle[i] = (dedx[i])*(k_high*(eangle[i])+b);
40 // cout << "eangle: " << eangle[i] << endl;
41 else denangle[i] = (dedx[i])*(k_low*(eangle[i])+b); // correct by a slope
42 }
43 TFile *f_save = new TFile("eangle_new.root","recreate");
44 TTree* entra = new TTree("entracalib", "entracalib");
45 entra->Branch("1denangle_entry", entry, "entry[1]/I");
46 entra->Branch("1denangle", denangle, "denangle[100]/D");
47 entra->Fill();
48 entra->Write();
49 f_save->Close();
50 f->Close();
51}
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
const bool b_trunc
Definition: slope.cxx:10
const double k_high
Definition: slope.cxx:7
const double b
Definition: slope.cxx:9
const double k_low
Definition: slope.cxx:8

Referenced by MdcSegInfoAxialO::calcFromOrigin(), MdcSegInfoSterO::calcStereo(), MdcSegInfoCsmc::calcStraight(), XtInteCalib::calib(), dEdxVsCosNP(), DedxCorrecSvc::EntaCorrec(), EsTimeAlg::execute(), MucRec2DRoad::Fit(), MucRec2DRoad::GetSimpleFitParams(), MucRec2DRoad::SimpleFit(), and MucRec2DRoad::SimpleFitNoCurrentGap().

Variable Documentation

◆ b

const double b = 1.0

Definition at line 9 of file slope.cxx.

Referenced by AsymGauss(), MucRec2DRoad::AttachHit(), TofQCorrSvc::BQRaw1(), TofQCorrSvc::BQRaw2(), EmcRecGeoPlane::Build(), EvtbTosllVectorAmp::CalcAmp(), EvtbTosllAmp::CalcMaxProb(), EvtSemiLeptonicAmp::CalcMaxProb(), HoughStereo::cald(), HoughTrack::cald_layer(), TMLink::cDrift(), CFCir::CFCir(), Lpar::circle(), compare_zsfit(), MucGeoGap::CompareIntersection(), ExtBesEmcEndGeometry::ComputeDimAndPos(), BesEmcEndGeometry::ComputeDimAndPos(), db_mysql::Connect(), BesTofConstruction::ConstructBr1Tof(), BesTofConstruction::ConstructBr2Tof(), BesTofConstruction::ConstructEcTof(), DifNumber::correlation(), TMLink::dDrift(), EvtBsquark::decay(), BesPolygon2D::DistancetoPrimitive(), TRunge::DisToWire(), TTrackManager::divide(), TTrackManager::divideByIp(), TMLink::drift(), EmcRecGeoPlane::EmcRecGeoPlane(), TrkHotListFull::endFoundRange(), Kinem< R >::eq(), TofQCorrSvc::EQRaw(), EvtPawt(), MagFieldReader::execute(), EvtSpinAmp::extcont(), MagneticFieldSvc::fieldVector(), MucGeoGeneral::FindIntersection(), MucGeoGeneral::FindIntersectionQuadLocal(), MucGeoGeneral::FindIntersectionSurface(), TConformalFinder0::findSegments(), MdcxFindTracks::findz_cyl(), MucRec2DRoad::Fit(), TCosmicFitter::fit(), RealDBUtil::ConnectionProvider::getcal(), TRadSpline3::GetCoeff(), TRadSpline5::GetCoeff(), BesTView::GetDistancetoAxis(), ExtBesMagneticField::GetFieldValue(), BesMagneticField::GetFieldValue(), MucGeometron::GetIntersectionQuadPlane(), MucGeometron::GetIntersectionQuadPlaneLocal(), MucMagneticField::getMucField(), MucRec2DRoad::GetSimpleFitParams(), BesTofConstruction::getXYZ(), DedxCorrecSvc::I2D(), HadronSaturation::I2D(), EvtSpinAmp::intcont(), ParticleIDBase::interpolation(), HoughZsFit::leastFit(), HoughTrack::Leastfit(), HoughZsFit::leastLine(), less_layer(), less_layer_3D(), MucRecLineFit::LineFit(), main(), HTrackParameter::minDistanceTwoHelix(), mwCalloc(), mwCalloc_(), Kinem< R >::neq(), rdbModel::ColCompare::operator()(), rdbModel::FieldValCompare::operator()(), MdcUtilitySvc::pointOnHelixPatPar(), HTrackParameter::positionTwoHelix(), MucRec2DRoad::Project(), MucRec3DRoad::Project(), MucRec3DRoad::ProjectNoCurrentGap(), MucGeoGap::ProjectToGap(), MucGeoGap::ProjectToGapQuadLocal(), MucGeoGap::ProjectToGapSurface(), MucRec3DRoad::ProjectWithSigma(), MucRecQuadFit::QuadFit(), FTTrack::r_phi2Fit(), FTTrack::r_phi3Fit(), FTTrack::r_phi4Fit(), FTTrack::r_phiReFit(), KalFitTrack::radius_numf(), MdcTSF::ReadLut(), MdcTF::ReadTFLut(), BesEmcConstruction::RotAngleFromNewZ(), DifVector::rotate(), Lpar::s(), TMSelector::select(), eformat::write::set(), RootInterface::setBranchAddress(), rdbModel::Manager::setBuilder(), BesEventHeader::SetEventHeaderGeneral(), XmlRpc::XmlRpcSource::setKeepOpen(), EvtGammaMatrix::sigmaLower(), EvtGammaMatrix::sigmaUpper(), slope(), small_layer(), EvtConExc::SoftPhoton_xs(), solveQuad(), TTrackManager::sortBanksByPt(), sortByArcLength(), SortByB(), SortByPt(), sortBySequentialLength(), SortByWireId(), sortByWireSerialNumber(), SortByX(), EvtPolInt::splint(), EvtSVVHelAmp::SVVHel(), ers::Core::to_string(), TrackStatus(), and MagneticFieldSvc::uniFieldVector().

◆ b_trunc

const bool b_trunc = true

Definition at line 10 of file slope.cxx.

Referenced by slope().

◆ k_high

const double k_high = 0.0

Definition at line 7 of file slope.cxx.

Referenced by slope().

◆ k_low

const double k_low = 0.0

Definition at line 8 of file slope.cxx.

Referenced by slope().