Commit 9985770a authored by Luca Mastrolorenzo's avatar Luca Mastrolorenzo

Addition of the center-of-gravity methods to the TrgC3d class + Addition of...

Addition of the center-of-gravity methods to the TrgC3d class + Addition of the shared energy between two C3d clusters in TrgC3d + update of the launcherIC.py
parent b69575e8
......@@ -341,7 +341,7 @@ public:
//std::vector<Particle> &vPhoton( event.photons(e) );/ std::vector<Particle> &vSignal( event.photons(e) );
//LucaModif std::vector<Particle> &vSignal( event.photons(e) );
std::vector<Particle> &vSignal( event.taus(e) );
std::vector<Particle> &vSignal( event.electrons(e) );
// std::cout << "v " << e << " " << vPhoton.size() << std::endl;
......
......@@ -142,7 +142,8 @@ public:
}
double phi() const {
return energy()*fPoint.phi();
//return energy()*fPoint.phi();
return fPoint.phi();
}
// Access to TrgHit information
......@@ -395,6 +396,11 @@ public:
return sqrt( ( fCenter.first-p->position().x() ) * ( fCenter.first-p->position().x() ) + ( fCenter.second-p->position().y() ) * ( fCenter.second-p->position().y() ) );
}
double distFromPoint(Point2D *p){
return sqrt( ( fCenter.first-p->x() ) * ( fCenter.first-p->x() ) + ( fCenter.second-p->y() ) * ( fCenter.second-p->y() ) );
}
/* near neighbour */
bool isNeighbour(TrgHit* trgHitToTest){
......
......@@ -183,11 +183,72 @@ public:
return fCenterNorm;
}
pair<float,float> centerEtaPhi(){
pair<float,float> fCenterEtaPhi(0.0, 0.0);
float etaC3d(0.0);
float phiC3d(0.0);
double e(0.0);
for(unsigned i(0);i<vTrgC2d.size();i++) {
etaC3d += vTrgC2d[i]->transverseMips() * (vTrgC2d[i]->centerEtaPhi()).first;
phiC3d += vTrgC2d[i]->transverseMips() * (vTrgC2d[i]->centerEtaPhi()).second;
e+=vTrgC2d[i]->transverseMips();
}
fCenterEtaPhi.first = etaC3d / e;
fCenterEtaPhi.second = phiC3d / e;
return fCenterEtaPhi;
}
pair<float,float> CoGNorm(){
float xC3d(0.0);
float yC3d(0.0);
float zC3d(0.0);
double e(0.0);
for(unsigned i(0);i<vTrgC2d.size();i++) {
xC3d += vTrgC2d[i]->transverseMips() * (vTrgC2d[i]->center()).first;
yC3d += vTrgC2d[i]->transverseMips() * (vTrgC2d[i]->center()).second;
zC3d += vTrgC2d[i]->transverseMips() * Geometry::layerZ(fEndcap,vTrgC2d[i]->layer());
e+=vTrgC2d[i]->transverseMips();
}
fCoGNorm.first = ( xC3d / e ) / ( zC3d / e ) ;
fCoGNorm.second = ( yC3d / e ) / ( zC3d / e );
return fCoGNorm;
}
float length(){
float fLenght = fabs( Geometry::layerZ(fEndcap,vTrgC2d.back()->layer()) - Geometry::layerZ(fEndcap,vTrgC2d.front()->layer()) );
return fLenght;
}
float C2dDistanceNorm( pair<float,float> C2dCenter ){
double dist = sqrt( (fCenterNorm.first-C2dCenter.first)*(fCenterNorm.first-C2dCenter.first) + (fCenterNorm.second-C2dCenter.second)*(fCenterNorm.second-C2dCenter.second) ) ;
float dist = sqrt( (fCenterNorm.first-C2dCenter.first)*(fCenterNorm.first-C2dCenter.first) + (fCenterNorm.second-C2dCenter.second)*(fCenterNorm.second-C2dCenter.second) ) ;
return dist;
}
float C3dDistanceNorm( TrgC3d *Clu3d ){
float dist = sqrt( ( fCoGNorm.first - Clu3d->CoGNorm().first )*( fCoGNorm.first - Clu3d->CoGNorm().first ) + ( fCoGNorm.second - Clu3d->CoGNorm().second )*( fCoGNorm.second - Clu3d->CoGNorm().second ) ) ;
return dist;
}
float C3dSharedTransverseMips( TrgC3d *Clu3d ){
double SharedMipT=0.0;
std::vector<TrgC2d*> extV = Clu3d->trgC2ds();
for(unsigned i(0); i<extV.size(); i++ ){
for(unsigned j(0); j<vTrgC2d.size(); j++ ){
if( vTrgC2d[j]->getUniqueId() == extV[i]->getUniqueId() ){
SharedMipT+=vTrgC2d[j]->transverseMips();
}
}
}
return SharedMipT;
}
Point position() const {
return fPosition;
}
......@@ -371,6 +432,9 @@ private:
unsigned fNumberOfDof;
Particle *fParticle;
pair<float,float> fCenterNorm;
pair<float,float> fCoGNorm;
pair<float,float> fCenterEtaPhi;
float fLenght;
};
......
......@@ -7,21 +7,39 @@ double calibCluster(double dep[]){
//coefficient from C3d pions
double C3dCluCoeff_26l[52] = { 0, 0.0496421, 0, 0.0406136, 0, 0.0841348, 0, 0.0510543, 0, 0.0733869, 0, 0.0307511, 0, 0.0641894, 0, 0.0855152, 0, 0.0330387, 0, 0.0623249, 0, 0.0673885, 0, 0.067226, 0, 0.0921128, 0, 0.0835333, 0.103395, 0.0981839, 0.104409, 0.103367, 0.113767, 0.0369492, 0.0989041, 0.127434, 0.143822, 0.0649015, 0.0555431, 0.18853, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0. };
double MaxCluCoeffPi_26l_PU200[52]={ 0., 0.096771, 0., 0.154984, 0., 0.0779117, 0., 0.0391791, 0., 0.0202955, 0., -0.00381858, 0., 0.0310921, 0., 0.0345703, 0., 0.0468705, 0., 0.0265336, 0., 0.0499438, 0., 0.0400726, 0., 0.0617824, 0., 0.0555374, 0.0868473, 0.0817456, 0.0630983, 0.0738757, 0.0833486, 0.0631033, 0.085771, 0.0676589, 0.0921196, 0.0785368, 0.0359822, 0.287156, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.};
//coefficient from photons - most energetic 2Dcluster/layer - 1.6<|eta|<2.8 - Seed Threshold = 10 mips, TrgHit Threshold = 5 mips
double MaxCluCoeffGamma_26l[52] = { 0., -0.0219692, 0., 0.060302, 0., 0.0294461, 0., 0.0273296, 0., 0.0235929, 0., 0.0276696, 0., 0.0271923, 0., 0.0291319, 0., 0.0331845, 0., 0.0338663, 0., 0.0441056, 0., 0.0134572, 0., 0.00226337, 0., 0.080997, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0. , 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.};
double MaxCluCoeffGamma_26l_PU200[52] = { 0., -0.0809621, 0., 0.0374175, 0., 0.0464561, 0., 0.0293506, 0., 0.013936, 0., 0.0195492, 0., 0.0292146, 0., 0.0284587, 0., 0.04483, 0., 0.00696123, 0., 0.0471003, 0., 0.0268109, 0., 0.0396946, 0., 0.119308, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0. , 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.};
//double MaxCluCoeffGamma_26l_PU200[52] = { 0., -0.0599269, 0., 0.0402738, 0., 0.040123, 0., 0.0290021, 0., 0.0253999, 0., 0.019065, 0., 0.0200553, 0., 0.0432537, 0., 0.0156327, 0., 0.0515298, 0., 0.03971, 0., 0.00684734, 0., 0.0495789, 0., 0.127418, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0. , 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.};
//double MaxCluCoeffGamma_26l_PU200[52] = { 0., -0.0603812, 0., 0.0512034, 0., 0.0377916, 0., 0.0217979, 0., 0.0321427, 0., 0.0186655, 0., 0.0333685, 0., 0.026813, 0., 0.0282801, 0., 0.039641, 0., 0.0450659, 0., 0.014953, 0., 0.0540349, 0., 0.143498, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0. , 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.};
//double MaxCluCoeffGamma_26l_PU200[52] = { 0., -0.0564826, 0., 0.0468913, 0., 0.0363248, 0., 0.0252378, 0., 0.0347685, 0., 0.022995, 0., 0.0277085, 0., 0.0219204, 0., 0.0400089, 0., 0.0418655, 0., 0.0405099, 0., 0.00744019, 0., 0.071766, 0., 0.144541, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0. , 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.};
//low thresholds
//SE=5 TE=2
//double MaxCluCoeffGamma_26l_PU200_0[52] = { 0., 0.0374321, 0., 0.0272364, 0., 0.0156208, 0., 0.0326081, 0., 0.0179549, 0., 0.0182417, 0., 0.022536, 0., 0.0179443, 0., 0.0337885, 0., 0.030553, 0., 0.0226521, 0., 0.0555469, 0., 0.0511783, 0., -0.000738704, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0. , 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.};
//SE=10 TE=2
//double MaxCluCoeffGamma_26l_PU200_1[52] = { 0., 0.0107559, 0., 0.0466378, 0., 0.0146156, 0., 0.0290959, 0., 0.0173818, 0., 0.0195449, 0., 0.024002, 0., 0.0203891, 0., 0.0271457, 0., 0.0316444, 0., 0.0321694, 0., 0.0501885, 0., 0.0293529, 0., 0.0206603, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0. , 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.};
//SE=15 TE=2
//double MaxCluCoeffGamma_26l_PU200_2[52] = { 0., -0.0203472, 0., 0.0592316, 0., 0.0153729, 0., 0.0274374, 0., 0.0195412, 0., 0.0195961, 0., 0.0192241, 0., 0.0220731, 0., 0.0318459, 0., 0.031793, 0., 0.0330946, 0., 0.0456689, 0., 0.0235729, 0., 0.0220866, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0. , 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.};
//SE=25 TE=2
double MaxCluCoeffGamma_26l_PU200_3[52] = { 0., -0.0368211, 0., 0.0460783, 0., 0.0198967, 0., 0.0293057, 0., 0.0196438, 0., 0.0217098, 0., 0.0193689, 0., 0.0204774, 0., 0.0295688, 0., 0.0348411, 0., 0.039395, 0., 0.0318608, 0., 0.018608, 0., 0.0462604, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0. , 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.};
for(int i=0; i<40; i++){
// %%%% For pions
// E += dep[i] * MaxCluCoeff_26l[i];
// E += dep[i] * C3dCluCoeff_26l[i];
// %%%% For photons
// %%%% For photons
//E += dep[i] * MaxCluCoeffGamma_26l[i];
E += dep[i] * MaxCluCoeffGamma_26l_PU200[i];
std::cout << " dep[i]*a[i] = " << dep[i] <<" * " << C3dCluCoeff_26l[i] << " = " <<E << std::endl;
//Gamma MaxC3d with PU200
//E += dep[i] * MaxCluCoeffGamma_26l_PU200_3[i];
E += dep[i] * MaxCluCoeffPi_26l_PU200[i];
std::cout << " dep[i]*a[i] = " << dep[i] <<" * " << MaxCluCoeffPi_26l_PU200[i] << " = " <<E << std::endl;
}
return E;
}
......@@ -200,9 +200,9 @@ fileReport.close()
fileSh_toBatch = open('submitJobs.sh', 'w')
for fileName in fileSh_nameList :
if mail == "y" :
fileSh_toBatch.write('qsub -cwd -q hep.q -l h_rt='+str(h)+':'+str(m)+':'+str(sec)+' -l s_rt='+str(h_s)+':'+str(m_s)+':'+str(sec_s)+' -m ea -M l.mastrolorenzo@imperial.ac.uk '+fileName+' \n')
fileSh_toBatch.write('qsub -cwd -q hep.q -l h_vmem=20G -l h_rt='+str(h)+':'+str(m)+':'+str(sec)+' -l s_rt='+str(h_s)+':'+str(m_s)+':'+str(sec_s)+' -m ea -M l.mastrolorenzo@imperial.ac.uk '+fileName+' \n')
else :
fileSh_toBatch.write('qsub -cwd -q hep.q -l h_rt='+str(h)+':'+str(m)+':'+str(sec)+' -l s_rt='+str(h_s)+':'+str(m_s)+':'+str(sec_s)+' '+fileName+' \n')
fileSh_toBatch.write('qsub -cwd -q hep.q -l h_vmem=20G -l h_rt='+str(h)+':'+str(m)+':'+str(sec)+' -l s_rt='+str(h_s)+':'+str(m_s)+':'+str(sec_s)+' '+fileName+' \n')
os.chmod( 'submitJobs.sh', 0555 )
fileSh_toBatch.close()
......
......@@ -70,7 +70,7 @@ public:
DistanceCut=-1;
outDirName = "";
int ch;
while ((ch = getopt(argc, argv, "a:b:d:f:hj:n:p:s:e:t:o:")) != -1) {
while ((ch = getopt(argc, argv, "a:b:d:f:hj:n:p:s:e:t:r:o:")) != -1) {
switch (ch) {
case 'a':
{std::istringstream sin(optarg); sin >> nAnalysis;}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment