Skip to content

Hot fix for FastOffline#271

Merged
plexoos merged 5 commits intostar-bnl:mainfrom
akioogawa:PR20211227
Dec 29, 2021
Merged

Hot fix for FastOffline#271
plexoos merged 5 commits intostar-bnl:mainfrom
akioogawa:PR20211227

Conversation

@akioogawa
Copy link
Copy Markdown
Contributor

StFcsWaveformFitMaker default value for mEnergySelect to 10 (for data, default was 0 for MC before)
StFcsDbMaker remove delete mFcsDb from Finish, since it is double delete because of AddData in constructor
StSpinPool/StFcsPi0FinderForEcal remove TriggerId selection and ToFMult selection for FastOffline (not needed).

int tofMult = trg->tofMultiplicity();
// cout<<"TOF mult="<<tofMult<<endl;
if (tofMult > 20) return kStOK;
*/
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just remove these lines?

Copy link
Copy Markdown
Contributor Author

@akioogawa akioogawa Dec 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed TriggerId part. This should be done outside this analysis maker, for example in macro using StSpinPool/StTriggerFilterMaker.

TOFmult part remains since it is in correct place and should work, just that it is not working currently when reading from Mudst. I would like to add something like following to StFcsRawHitMaker::readMuDst() (or StMuDst::createStEvent() function), but I cannot make it work. In short,
const StTriggerData* StMuEvent::triggerData()
cannot feed
StEvent::setTriggerData(StTriggerata*)
due to StStrArray::TestBit(kBelongs) fails, even after removing const by "const_cast". Please let me know if someones mater than me knows solution (without copying entire TriggerData contents!)

if(mEvent->triggerData()==0){                                                                                                                                                                                
        StMuEvent* muevent = mudst->event();                                                                                                                                                                     
        if(muevent){                                                                                                                                                                                             
            StTriggerData* trg = const_cast(muevent->triggerData());                                                                                                                             
            if(trg){                                                                                                                                                                                             
                printf("AAA TOF=%d\n",trg->tofMultiplicity());                                                                                                                                                   
                mEvent->setTriggerData(trg);                                                                                                                                                                     
                // StStrArray::push_back(const TObject*): Assertion `!obj->TestBit(kBelongs)&& obj->TestBit(TObject::kNotDeleted)' failed.                                                                       
                printf("BBB TOF=%d\n",mEvent->triggerData()->tofMultiplicity());                                                                                                                                 
            }                                                                                                                                                                                                    
        }                                                                                                                                                                                                        
    } 

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you comment out Line 472: h2_EcalMult_vs_TofMult->Fill(tofMult, n_Ecal_cut); in StFcsPi0FinderForEcal.cxx . This line also use tofMult which is removed out by Akio. So please remove this line as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep it for now. When reading StTriggerData from Mudst is there (see above), we can put it back. O the other hand, this was too avoid mid-central events from AA collisions, and we may not need it for pp. Still once we have tofmult, we should study.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akioogawa I'm not sure that this is a valid use of const_cast you show here. I would start coding this in a similar way to how it was done in 9e95896, we can see if it can be refactored then.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another attempt following StEventMaker example :

    if(mEvent->triggerData()==0){
        StMuEvent* muevent = mudst->event();
        if(muevent){
            StTriggerData* trg = const_cast(muevent->triggerData());
            if(trg){
                printf("AAA TOF=%d\n",trg->tofMultiplicity());
                AddData(new TObjectSet("StTriggerData",trg));
                TObjectSet *os = (TObjectSet*)GetDataSet("StTriggerData");
                printf("BBB\n");
                if(os){
                    printf("CCC os->IsOwner()=%d\n",os->IsOwner());
                    StTriggerData* pTrg = (StTriggerData*)os->GetObject();
                    if(os->IsOwner() && pTrg){
                        printf("DDD TOF=%d\n",pTrg->tofMultiplicity());
                        os->DoOwner(0);
			printf("EEE\n");
                        mEvent->setTriggerData(trg);
                        printf("FFF TOF=%d\n",mEvent->triggerData()->tofMultiplicity());
                    }
		}
            }
        }
    }

==>

AAA TOF=17
BBB
CCC os->IsOwner()=1
DDD TOF=17
EEE
root4star: .sl73_gcc485/obj/StRoot/St_base/StArray.cxx:276: void StStrArray::push_back(const TObject*): Assertion `!obj->TestBit(kBelongs) && obj->TestBit(TObject::kNotDeleted)' failed.

…acro using StSpinPool/StTriggerFilterMaker, for example)

TOF mult part remains, since this is valid code, not working currently when reading from Mudst.
@plexoos
Copy link
Copy Markdown
Member

plexoos commented Dec 29, 2021

The two modified files are co-owned by @jdbrice

StRoot/StFcsDbMaker/StFcsDbMaker.cxx
StRoot/StFcsWaveformFitMaker/StFcsWaveformFitMaker.h

Please let us know whether it is worth waiting for a feedback.

@akioogawa
Copy link
Copy Markdown
Contributor Author

I know @jdbrice is very busy right now. I don't know why he is owner of those 2 makers. His feedback and reviews are always welcome. But if you have power to merge without his approval, please do, although I'm the one making the request and don't want to request a short-cut....

@plexoos
Copy link
Copy Markdown
Member

plexoos commented Dec 29, 2021

I don't know why he is owner of those 2 makers

@jdbrice was added by @starsdong for all files in /StRoot/StFcs*, see #40

https://github.com/star-bnl/star-sw/pull/40/files#diff-3d36a1bf06148bc6ba1ce2ed3d19de32ea708d955fed212c0d27c536f0bd4da7R51

Akio, I agree with you that any collaborator should be able to comment without being a maintainer. It is better to not designate an owner rather than creating a situation with unfulfillable expectations.

@plexoos plexoos merged commit b69633f into star-bnl:main Dec 29, 2021
//TOF mult cut
int tofMult = 0;
const StTriggerData* trgdata = event->triggerData();
if(!trgdata && StMuDst::event()) trgdata = StMuDst::event()->triggerData();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So StMuEvent provides StMuTriggerIdCollection, but not StMuTriggerData (stores a StTriggerData instead).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants