Skip to content

Commit

Permalink
Address compilation errors in StFwdAnalysisMaker
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Jul 26, 2023
1 parent ae1dae2 commit 64cebf5
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions StRoot/StFwdUtils/StFwdAnalysisMaker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,10 @@ int StFwdAnalysisMaker::Init() {
mHists[ "matchedEcaldR" ] = new TH1F( "matchedEcaldR", ";dr (trk - ecal); counts", 400, 0, 400 );

mHists[ "hcaldX" ] = new TH1F( "hcaldX", ";dx (trk - hcal); counts", 400, -200, 200 );
mHists[ "hcaldXdNFit" ] = new TH2F( "hcaldXdNFit", ";dx (trk - hcal); nFit", 400, -200, 200, 10, 0, 10 );
mHists[ "matchedHcaldX" ] = new TH1F( "matchedHcaldX", ";dx (trk - hcal); counts", 400, -200, 200 );
mHists[ "hcaldY" ] = new TH1F( "hcaldY", ";dy (trk - hcal); counts", 400, -200, 200 );
mHists[ "hcaldYdNFit" ] = new TH2F( "hcaldYdNFit", ";dy (trk - hcal); nFit", 400, -200, 200, 10, 0, 10 );
mHists[ "matchedHcaldY" ] = new TH1F( "matchedHcaldY", ";dy (trk - hcal); counts", 400, -200, 200 );
mHists[ "hcaldR" ] = new TH1F( "hcaldR", ";dr (trk - hcal); counts", 400, 0, 400 );
mHists[ "hcalMindR" ] = new TH1F( "hcalMindR", ";dr (trk - hcal); counts", 400, 0, 400 );
Expand Down Expand Up @@ -188,7 +190,7 @@ void StFwdAnalysisMaker::ProcessFwdTracks( ){
size_t fwdMultEcalClusters = 0;
size_t fwdMultHcalClusters = 0;
for ( int iDet = 0; iDet < 4; iDet++ ){
for( int i = 0; i < fcs->clusters(iDet).size(); i++){
for( size_t i = 0; i < fcs->clusters(iDet).size(); i++){
StFcsCluster * clu = fcs->clusters(iDet)[i];

if ( iDet < 2 ){
Expand Down Expand Up @@ -232,7 +234,6 @@ void StFwdAnalysisMaker::ProcessFwdTracks( ){
mHists["pt"]->Fill( fwdTrack->momentum().perp() );

// ecal proj
float c[9];
int detId = kFcsWcalId;
TVector3 ecalXYZ;
TVector3 ecapP;
Expand All @@ -242,7 +243,7 @@ void StFwdAnalysisMaker::ProcessFwdTracks( ){
LOG_INFO << "EcalProj z= " << ecalProj.mXYZ.z() << endm;
LOG_INFO << "HcalProj z= " << hcalProj.mXYZ.z() << endm;

for ( int iEcal = 0; iEcal < fwdTrack->ecalClusters().size(); iEcal++ ){
for ( size_t iEcal = 0; iEcal < fwdTrack->ecalClusters().size(); iEcal++ ){
StFcsCluster *clu = fwdTrack->ecalClusters()[iEcal];
LOG_INFO << "Ecal clu detId = " << clu->detectorId() << endm;
mHists["matchedEcalEnergy"]->Fill( clu->energy() );
Expand All @@ -260,7 +261,7 @@ void StFwdAnalysisMaker::ProcessFwdTracks( ){
double mindR = 999;
StFcsCluster * cclu = nullptr; // closet cluster
for ( int iDet = 0; iDet < 2; iDet++ ){
for( int i = 0; i < fcs->clusters(iDet).size(); i++){
for( size_t i = 0; i < fcs->clusters(iDet).size(); i++){
StFcsCluster * clu = fcs->clusters(iDet)[i];

StThreeVectorD xyz = mFcsDb->getStarXYZfromColumnRow(clu->detectorId(), clu->x(), clu->y());
Expand Down Expand Up @@ -298,7 +299,7 @@ void StFwdAnalysisMaker::ProcessFwdTracks( ){
double mindR = 999;
StFcsCluster * cclu = nullptr;
for ( int iDet = 2; iDet < 4; iDet++ ){
for( int i = 0; i < fcs->clusters(iDet).size(); i++){
for( size_t i = 0; i < fcs->clusters(iDet).size(); i++){
StFcsCluster * clu = fcs->clusters(iDet)[i];
if (!clu) continue;
StThreeVectorD xyz = mFcsDb->getStarXYZfromColumnRow(clu->detectorId(), clu->x(), clu->y());
Expand All @@ -308,10 +309,15 @@ void StFwdAnalysisMaker::ProcessFwdTracks( ){
float dy = hcalProj.mXYZ.y() - xyz.y();
float dr = sqrt(dx*dx + dy*dy);

if ( fabs(dy) < 25 )
if ( fabs(dy) < 25 ){
mHists[ "hcaldX" ]->Fill( dx );
if ( fabs(dx) < 25 )
mHists[ "hcaldXdNFit" ]->Fill( dx, fwdTrack->numberOfFitPoints() );

}
if ( fabs(dx) < 25 ){
mHists[ "hcaldY" ]->Fill( dy );
mHists[ "hcaldYdNFit" ]->Fill( dy, fwdTrack->numberOfFitPoints() );
}
mHists[ "hcaldR" ]->Fill( dr );

if ( dr < mindR ){
Expand Down Expand Up @@ -399,7 +405,6 @@ void StFwdAnalysisMaker::ProcessFwdMuTracks( ){


// ecal proj
float c[9];
int detId = kFcsWcalId;
TVector3 ecalXYZ;
TVector3 ecapP;
Expand All @@ -410,7 +415,7 @@ void StFwdAnalysisMaker::ProcessFwdMuTracks( ){
if (foundEcalProj){

// LOG_INFO << "EcalProj z= " << ecalProj.mXYZ.Z() << endm;
for( int i = 0; i < fcs->numberOfClusters(); i++){
for( size_t i = 0; i < fcs->numberOfClusters(); i++){
StMuFcsCluster * clu = fcs->getCluster(i);

if ( clu->detectorId() > 1 ) continue;
Expand All @@ -434,7 +439,7 @@ void StFwdAnalysisMaker::ProcessFwdMuTracks( ){
}


for ( size_t i = 0; i < muFwdTrack->mEcalClusters.GetEntries(); i++ ){
for ( int i = 0; i < muFwdTrack->mEcalClusters.GetEntries(); i++ ){
auto c = (StMuFcsCluster*) muFwdTrack->mEcalClusters.At(i);
if (!c) continue;
mHists["ecalEnergy"]->Fill( c->energy() );
Expand All @@ -452,7 +457,7 @@ void StFwdAnalysisMaker::ProcessFwdMuTracks( ){
mHists["ecalMatchPerTrack"]->Fill( muFwdTrack->mEcalClusters.GetEntries() );
mHists["hcalMatchPerTrack"]->Fill( muFwdTrack->mHcalClusters.GetEntries() );

for ( size_t i = 0; i < muFwdTrack->mHcalClusters.GetEntries(); i++ ){
for ( int i = 0; i < muFwdTrack->mHcalClusters.GetEntries(); i++ ){
auto c = (StMuFcsCluster*) muFwdTrack->mHcalClusters.At(i);
if (!c) continue;
mHists["hcalEnergy"]->Fill( c->energy() );
Expand Down

0 comments on commit 64cebf5

Please sign in to comment.