Skip to content
Snippets Groups Projects
Commit 5e8daa5a authored by Michael Leyhe's avatar Michael Leyhe
Browse files

JpsiGamEtaPiPiNew: Changed some minor things

parent f91ac7aa
No related branches found
No related tags found
No related merge requests found
......@@ -8,19 +8,19 @@ JpsiGamEtaPiPiReader::JpsiGamEtaPiPiReader()
{}
JpsiGamEtaPiPiReader::JpsiGamEtaPiPiReader(const std::vector<std::string>& files, int particles, int skip):
numParticles(particles),
linesToSkip(skip),
_useMassRange(false),
_massRange(std::make_pair(0.,10.) )
numParticles(particles),
linesToSkip(skip),
_useMassRange(false),
_massRange(std::make_pair(0.,10.) )
{
if (0 == files.size()) {
Alert << "empty list of event files" ; // << endmsg;
exit(1);
}
std::vector<std::string>::const_iterator iter = files.begin();
for (; iter != files.end(); ++iter)
fileNames.push_back(*iter);
currentFile = fileNames.begin();
if (0 == files.size()) {
Alert << "empty list of event files" ; // << endmsg;
exit(1);
}
std::vector<std::string>::const_iterator iter = files.begin();
for (; iter != files.end(); ++iter)
fileNames.push_back(*iter);
currentFile = fileNames.begin();
}
JpsiGamEtaPiPiReader::~JpsiGamEtaPiPiReader()
......@@ -28,41 +28,41 @@ JpsiGamEtaPiPiReader::~JpsiGamEtaPiPiReader()
bool JpsiGamEtaPiPiReader::fillAll(EventList& evtList)
{
while (currentFile != fileNames.end()) {
currentStream.open(currentFile->c_str());
if (!currentStream) {
Alert << "can not open " << *currentFile ; // << endmsg;
exit(1);
}
while (!currentStream.eof()) {
double e,px,py,pz;
Event* newEvent = new Event();
int parts;
Vector4<double> fvPiPiEta(0.,0.,0.,0.);
for (parts = 0; parts < numParticles; parts++) {
currentStream >> px >> py >> pz >> e;
newEvent->addParticle(e,px,py,pz);
Vector4<double> tmp = newEvent->p4(parts);
if(parts>0) fvPiPiEta+= tmp;
}
if(_useMassRange){
if(fvPiPiEta.Mass()<_massRange.first || fvPiPiEta.Mass()>_massRange.second ) continue;
}
if (!currentStream.fail()) {
evtList.add(newEvent);
for (parts = 0; parts < linesToSkip; parts++)
currentStream >> px >> py >> pz >> e;
}
}
currentStream.close();
++currentFile;
}
evtList.rewind();
return true; // success
while (currentFile != fileNames.end()) {
currentStream.open(currentFile->c_str());
if (!currentStream) {
Alert << "can not open " << *currentFile ; // << endmsg;
exit(1);
}
while (!currentStream.eof()) {
double e,px,py,pz;
Event* newEvent = new Event();
int parts;
Vector4<double> fvPiPiEta(0.,0.,0.,0.);
for (parts = 0; parts < numParticles; parts++) {
currentStream >> px >> py >> pz >> e;
newEvent->addParticle(e,px,py,pz);
Vector4<double> tmp = newEvent->p4(parts);
if(parts>0) fvPiPiEta+= tmp;
}
if(_useMassRange){
if(fvPiPiEta.Mass()<_massRange.first || fvPiPiEta.Mass()>_massRange.second ) continue;
}
if (!currentStream.fail()) {
evtList.add(newEvent);
for (parts = 0; parts < linesToSkip; parts++)
currentStream >> px >> py >> pz >> e;
}
}
currentStream.close();
++currentFile;
}
evtList.rewind();
return true; // success
}
......@@ -116,19 +116,19 @@ int main(int __argc,char *__argv[]){
Warning << "could not find all particles" ; // << endmsg;
Info << "\nFile has " << eventsData.size() << " events. Each event has "
<< eventsData.nextEvent()->size() << " final state particles.\n" ; // << endmsg;
<< eventsData.nextEvent()->size() << " final state particles.\n" ; // << endmsg;
eventsData.rewind();
Event* anEvent;
int evtCount = 0;
while ((anEvent = eventsData.nextEvent()) != 0 && evtCount < 1) {
Info << "\n"
<< *(anEvent->p4(0)) << "\tm = " << anEvent->p4(0)->Mass() << "\n"
<< *(anEvent->p4(1)) << "\tm = " << anEvent->p4(1)->Mass() << "\n"
<< *(anEvent->p4(2)) << "\tm = " << anEvent->p4(2)->Mass() << "\n"
<< *(anEvent->p4(3)) << "\tm = " << anEvent->p4(3)->Mass() << "\n"
; // << endmsg;
++evtCount;
Info << "\n"
<< *(anEvent->p4(0)) << "\tm = " << anEvent->p4(0)->Mass() << "\n"
<< *(anEvent->p4(1)) << "\tm = " << anEvent->p4(1)->Mass() << "\n"
<< *(anEvent->p4(2)) << "\tm = " << anEvent->p4(2)->Mass() << "\n"
<< *(anEvent->p4(3)) << "\tm = " << anEvent->p4(3)->Mass() << "\n"
; // << endmsg;
++evtCount;
}
eventsData.rewind();
......@@ -143,9 +143,10 @@ int main(int __argc,char *__argv[]){
//
//calculate helicity angles, fill map with D-functions
//
boost::shared_ptr<const JpsiGamEtaPiPiEventListNew> theJpsiGamEtaPiPiEventListPtr(new JpsiGamEtaPiPiEventListNew(eventsData, eventsMc));
std::string mode=theAppParams.mode();
std::string mode=theAppParams.mode();
std::cout << "Mode: " << mode << std::endl;
if (mode=="plotmode"){
JpsiGamEtaPiPiHistNew theHist(theJpsiGamEtaPiPiEventListPtr,theAppParams.massRange());
......@@ -158,11 +159,8 @@ int main(int __argc,char *__argv[]){
//
boost::shared_ptr<JpsiGamEtaPiPiStates> jpsiGamEtaPiPiStatesPtr(new JpsiGamEtaPiPiStates());
const std::vector<std::string> hypVec=theAppParams.enabledHyps();
boost::shared_ptr<AbsLhNew> theLhPtr;
std::string startWithHyp=theAppParams.startHypo();
......@@ -307,6 +305,9 @@ int main(int __argc,char *__argv[]){
JpsiGamEtaPiPiHistNew theHist(theLhPtr, finalFitParams,theAppParams.massRange());
//theHist.setMassRange(theAppParams.massRange() );
// // theHist.fill();
end= clock();
double cpuTime= (end-start)/ (CLOCKS_PER_SEC);
Info << "cpuTime:\t" << cpuTime << "\tsec" << endmsg;
return 0;
}
......
......@@ -228,28 +228,28 @@ complex<double> XDecAmpBase::XToAPiBWAmp(Spin lamX, Spin jA, EvtDataNew* theData
for ( itXMag=etaToAPiMag.begin(); itXMag!=etaToAPiMag.end(); ++itXMag){
boost::shared_ptr<const JPCLS> XState=itXMag->first;
double theXMag=itXMag->second;
double theXPhi=etaToAPiPhi[XState];
complex<double> expiphiX(cos(theXPhi), sin(theXPhi));
complex<double> amp(0.,0.);
for(Spin lamA = -jA; lamA <= jA; lamA++){
if( fabs(lamA)> _spinX || fabs(lamA)>XState->S) continue;
amp += theXMag*expiphiX*sqrt(2.*XState->L+1.)*sqrt(2.*jA + 1.)
*( conj(theData->WignerDsDec[enumJpsiGamEtaPiPiDfunc::XToAplusPiminus][_spinX][lamX][lamA])
*BreitWignerBlattW(p4EtaPiplus, _massPi, _massEta, aMass, aWidth, jA)
*conj(theData->WignerDsDec[enumJpsiGamEtaPiPiDfunc::XToAplusPiminus][jA][lamA][0])+
conj(theData->WignerDsDec[enumJpsiGamEtaPiPiDfunc::XToAminusPiplus][_spinX][lamX][lamA])
*BreitWignerBlattW(p4EtaPiminus, _massPi, _massEta, aMass, aWidth, jA)
*conj(theData->WignerDsDec[enumJpsiGamEtaPiPiDfunc::XToAminusPiplus][jA][lamA][0])
);
}
result+= amp;
}
boost::shared_ptr<const JPCLS> XState=itXMag->first;
double theXMag=itXMag->second;
double theXPhi=etaToAPiPhi[XState];
complex<double> expiphiX(cos(theXPhi), sin(theXPhi));
complex<double> amp(0.,0.);
for(Spin lamA = -jA; lamA <= jA; lamA++){
if( fabs(lamA)> _spinX || fabs(lamA)>XState->S) continue;
amp += theXMag*expiphiX*sqrt(2.*XState->L+1.)*sqrt(2.*jA + 1.)
*( conj(theData->WignerDsDec[enumJpsiGamEtaPiPiDfunc::XToAplusPiminus][_spinX][lamX][lamA])
*BreitWignerBlattW(p4EtaPiplus, _massPi, _massEta, aMass, aWidth, jA)
*conj(theData->WignerDsDec[enumJpsiGamEtaPiPiDfunc::XToAplusPiminus][jA][lamA][0])+
conj(theData->WignerDsDec[enumJpsiGamEtaPiPiDfunc::XToAminusPiplus][_spinX][lamX][lamA])
*BreitWignerBlattW(p4EtaPiminus, _massPi, _massEta, aMass, aWidth, jA)
*conj(theData->WignerDsDec[enumJpsiGamEtaPiPiDfunc::XToAminusPiplus][jA][lamA][0])
);
}
result+= amp;
}
return result;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment