Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ macros/data
.DS_Store
.nfs*
compiled/E20009Analysis/.NabinWorkDir/
macro/Unpack_HDF5/E535_RCNP/trace.csv
1 change: 1 addition & 0 deletions AtData/AtDataLinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#pragma link C++ class AtTrackingEvent + ;
#pragma link C++ class AtProtoQuadrant + ;
#pragma link C++ class AtTrack + ;
#pragma link C++ struct AtTrack::BraggCurve + ;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Why was this needed? Was there any warning when compiling regarding this? Just curious.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This (and the AtData comment above) were one of the issues we were running into when trying to compile the Unpacker on my local server. Any time I attempted to build, it would warn me that no such type existed within AtTrack. We resolve the issue by including the AtData directory in AtEventDisplay

#pragma link C++ class AtFittedTrack + ;
#pragma link C++ class AtFissionEvent + ;
#pragma link C++ class AtGenericTrace + ;
Expand Down
86 changes: 84 additions & 2 deletions AtData/AtSiEvent.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ void AtSiEvent::Clear(Option_t *opt)
fADCMaxFront2[i] = -1;
fADCMaxBack2[i] = -1;

fStripFront2[i] = -1;
fStripBack2[i] = -1;
fStripFront1[i] = -1;
fStripBack1[i] = -1;
fStripFront2[i] = -1;
fStripBack2[i] = -1;
}
Expand All @@ -64,3 +64,85 @@ void AtSiEvent::Clear(Option_t *opt)
fMultiplicityFront2 = 0;
fMultiplicityBack2 = 0;
}

void AtSiEvent::BuildHits() { //Returning strips to build physical map of Si detectors. For now focusing on multiplicity of 1 or 2
bool valid1 = true;
if (fMultiplicityFront1 == 1) { //To-Do: there are many strips within the reaction runs that have a multiplicity>2. Might be beneficial to implement other combinations of multiplicities so we are not throwing out data.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

If there are not many with multiplicity>2, maybe it's not such a big priority.

However, it may be easy to generalize looking at what you do in mult=2 case.

Something like the following maybe?

Energy = 0
maxEnergy = -1
for (int hitID=0; hitID<mult; hitID++) {
Energy += E[hitID]
if (E[hitID] > maxEnergy) {
maxEnergy = E[hitID]
X (or Y) = Strip[hitID]%128
}
}

Of course, there would need to be a check to see if all hits are in consecutive strips and set the valid variable according to that.

Maybe it is also worth considering adding a clustering step before this part of the analysis so that different clusters of hits can be analyzed separately. But maybe it is not a priority right now.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

When looking at a run of the reaction data, there were <=500 counts for both multiplicity 3 and 4. I was and am still unsure if we should completely disregard this amount of data. For the calibration runs on the Si, I agree it might not be a priority right now but could definitely come up in the future in regards to the reaction data.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I agree that we should not disregard this data, since it is still usable with an easy change to this part of the code. So in the following pull requests you can work on that.
If I remember correctly, there were about 32000 events in 1 run for most experiments, or maybe that was only in the last one? I am not sure, but <=500 is still not too much I think.

//everything is easy
fXStrip1 = fStripFront1[0]%128;
fEnergyFront1 = fEFront1[0];
}
else if (fMultiplicityFront1 == 2) {
if (abs(fStripFront1[0] - fStripFront1[1]) == 1) { //neighbours
fEnergyFront1 = fEFront1[0] + fEFront1[1];
//take strip from whichever has larger energy
if (fEFront1[0] > fEFront1[1]) { fXStrip1 = fStripFront1[0]%128; }
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

It may also be worth adding a center of gravity variable? I am not sure if it could be useful, but this would be the mean Strip value weighted by energy.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Hmm this could be useful for exact positioning on the strips and also could be more useful for higher multiplicity values.

else { fXStrip1 = fStripFront1[1]%128; }
}
else { valid1 = false; }
}
else { valid1 = false; }

if (fMultiplicityBack1 == 1) {
//everything is easy
fYStrip1 = 128-fStripBack1[0]%128;
fEnergyBack1 = fEBack1[0];
}
else if (fMultiplicityBack1 == 2) {
if (abs(fStripBack1[0] - fStripBack1[1]) == 1) { //neighbours
fEnergyBack1 = fEBack1[0] + fEBack1[1];
//take strip from whichever has larger energy
if (fEBack1[0] > fEBack1[1]) { fYStrip1 = 128-fStripBack1[0]%128; }
else { fYStrip1 = 128-fStripBack1[1]%128; }
}
else { valid1 = false; }
}
else { valid1 = false; }

bool valid2 = true;
if (fMultiplicityFront2 == 1) {
//everything is easy
fXStrip2 = fStripFront2[0]%128;
fEnergyFront2 = fEFront2[0];
}
else if (fMultiplicityFront2 == 2) {
if (abs(fStripFront2[0] - fStripFront2[1]) == 1) { //neighbours
fEnergyFront2 = fEFront2[0] + fEFront2[1];
//take strip from whichever has larger energy
if (fEFront2[0] > fEFront2[1]) { fXStrip2 = fStripFront2[0]%128; }
else { fXStrip2 = fStripFront2[1]%128; }
}
else { valid2 = false; }
}
else { valid2 = false; }

if (fMultiplicityBack2 == 1) {
//everything is easy
fYStrip2 = 128-fStripBack2[0]%128;
fEnergyBack2 = fEBack2[0];
}
else if (fMultiplicityBack2 == 2) {
if (abs(fStripBack2[0] - fStripBack2[1]) == 1) { //neighbours
fEnergyBack2 = fEBack2[0] + fEBack2[1];
//take strip from whichever has larger energy
if (fEBack2[0] > fEBack2[1]) { fYStrip2 = 128-fStripBack2[0]%128; }
else { fYStrip2 = 128-fStripBack2[1]%128; }
}
else { valid2 = false; }
}
else { valid2 = false; }

if (valid1 == false) {
fYStrip1 = -1;
fXStrip1 = -1;
fEnergyFront1 = -1;
fEnergyBack1 = -1;
}
if (valid2 == false) {
fYStrip2 = -1;
fXStrip2 = -1;
fEnergyFront2 = -1;
fEnergyBack2 = -1;
}
Comment on lines +135 to +146
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Another way this can be done is by initializing all these to -1 at the beginning of the function. These would only be updated to the correct values in the cases where valid1(2) are kept true. This would make valid1(2) not needed anymore too.

Minor detail, so it is fine as is. If we consider refactoring this part of the code in the future, then this could be changed.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The idea behind this was that if either x or y doesn't have a valid value assigned, then all the values are marked as "invalid" - that way you can check any of them to see if a good hit has been reconstructed

}

21 changes: 21 additions & 0 deletions AtData/AtSiEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ class AtSiEvent : public AtBaseEvent {
Int_t fMultiplicityFront2 = 0;
Int_t fMultiplicityBack2 = 0;

Int_t fXStrip1 = -1; //positioning of strips class
Int_t fXStrip2 = -1;
Int_t fYStrip1 = -1;
Int_t fYStrip2 = -1;
Double_t fEnergyFront1 = -1; //storing energy of strips
Double_t fEnergyFront2 = -1;
Double_t fEnergyBack1 = -1;
Double_t fEnergyBack2 = -1;
Comment on lines +38 to +45
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

If you add these, I think you should take them into account in the swap function defined in line 54, in copy initializer in line 49 (the implementation is in the .cxx tho) and the Clear function in line 80 (implementation in the .cxx too).


public:
AtSiEvent();
AtSiEvent(const AtSiEvent &copy);
Expand Down Expand Up @@ -110,6 +119,18 @@ class AtSiEvent : public AtBaseEvent {
Int_t GetMultiplicityFront2() { return fMultiplicityFront2; }
Int_t GetMultiplicityBack2() { return fMultiplicityBack2; }

Int_t GetXStrip1() { return fXStrip1; }
Int_t GetXStrip2() { return fXStrip2; }
Int_t GetYStrip1() { return fYStrip1; }
Int_t GetYStrip2() { return fYStrip2; }

Double_t GetEnergyFront1() { return fEnergyFront1; }
Double_t GetEnergyFront2() { return fEnergyFront2; }
Double_t GetEnergyBack1() { return fEnergyBack1; }
Double_t GetEnergyBack2() { return fEnergyBack2; }

void BuildHits();

ClassDefOverride(AtSiEvent, 1);
};

Expand Down
66 changes: 66 additions & 0 deletions AtData/AtSiEvent_bkup.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#include "AtSiEvent.h"

#include "AtContainerManip.h"

#include <Rtypes.h>

#include <algorithm>
#include <string> // for string

ClassImp(AtSiEvent);

AtSiEvent::AtSiEvent() : AtBaseEvent("AtSiEvent") {}

AtSiEvent::AtSiEvent(const AtSiEvent &copy) : AtBaseEvent(copy),
fMultiplicityFront1(copy.fMultiplicityFront1), fMultiplicityBack1(copy.fMultiplicityBack1),
fMultiplicityFront2(copy.fMultiplicityFront2), fMultiplicityBack2(copy.fMultiplicityBack2)
{
for (int i = 0; i < 4; i++) {
fEFront1[i] = copy.fEFront1[i];
fEBack1[i] = copy.fEBack1[i];
fEFront2[i] = copy.fEFront2[i];
fEBack2[i] = copy.fEBack2[i];

fADCMaxFront1[i] = copy.fADCMaxFront1[i];
fADCMaxBack1[i] = copy.fADCMaxBack1[i];
fADCMaxFront2[i] = copy.fADCMaxFront2[i];
fADCMaxBack2[i] = copy.fADCMaxBack2[i];

fStripFront1[i] = copy.fStripFront1[i];
fStripBack1[i] = copy.fStripBack1[i];
fStripFront2[i] = copy.fStripFront2[i];
fStripBack2[i] = copy.fStripBack2[i];
}
}

AtSiEvent &AtSiEvent::operator=(AtSiEvent object)
{
swap(*this, object);
return *this;
}

void AtSiEvent::Clear(Option_t *opt)
{
AtBaseEvent::Clear(opt);
for (int i = 0; i < 4; i++) {
fEFront1[i] = -1;
fEBack1[i] = -1;
fEFront2[i] = -1;
fEBack2[i] = -1;

fADCMaxFront1[i] = -1;
fADCMaxBack1[i] = -1;
fADCMaxFront2[i] = -1;
fADCMaxBack2[i] = -1;

fStripFront2[i] = -1;
fStripBack2[i] = -1;
fStripFront2[i] = -1;
fStripBack2[i] = -1;
}

fMultiplicityFront1 = 0;
fMultiplicityBack1 = 0;
fMultiplicityFront2 = 0;
fMultiplicityBack2 = 0;
}
116 changes: 116 additions & 0 deletions AtData/AtSiEvent_bkup.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
#ifndef AtSIEVENT_H
#define AtSIEVENT_H

#include "AtBaseEvent.h"

#include <Rtypes.h>

#include <memory>
#include <type_traits>
#include <utility>
#include <vector>
class TBuffer;
class TClass;
class TMemberInspector;

class AtSiEvent : public AtBaseEvent {
private:
Double_t fEFront1[4] = {-1, -1, -1, -1};
Double_t fEBack1[4] = {-1, -1, -1, -1};
Double_t fEFront2[4] = {-1, -1, -1, -1};
Double_t fEBack2[4] = {-1, -1, -1, -1};

Double_t fADCMaxFront1[4] = {-1, -1, -1, -1};
Double_t fADCMaxBack1[4] = {-1, -1, -1, -1};
Double_t fADCMaxFront2[4] = {-1, -1, -1, -1};
Double_t fADCMaxBack2[4] = {-1, -1, -1, -1};

Int_t fStripFront1[4] = {-1, -1, -1, -1};
Int_t fStripBack1[4] = {-1, -1, -1, -1};
Int_t fStripFront2[4] = {-1, -1, -1, -1};
Int_t fStripBack2[4] = {-1, -1, -1, -1};

Int_t fMultiplicityFront1 = 0;
Int_t fMultiplicityBack1 = 0;
Int_t fMultiplicityFront2 = 0;
Int_t fMultiplicityBack2 = 0;

public:
AtSiEvent();
AtSiEvent(const AtSiEvent &copy);
AtSiEvent(const AtBaseEvent &copy) : AtBaseEvent(copy) { SetName("AtSiEvent"); }
AtSiEvent &operator=(const AtSiEvent object);
virtual ~AtSiEvent() = default;

friend void swap(AtSiEvent &first, AtSiEvent &second)
{
using std::swap;
swap(dynamic_cast<AtBaseEvent &>(first), dynamic_cast<AtBaseEvent &>(second));

swap(first.fEFront1, second.fEFront1);
swap(first.fEBack1, second.fEBack1);
swap(first.fEFront2, second.fEFront2);
swap(first.fEBack2, second.fEBack2);

swap(first.fADCMaxFront1, second.fADCMaxFront1);
swap(first.fADCMaxBack1, second.fADCMaxBack1);
swap(first.fADCMaxFront2, second.fADCMaxFront2);
swap(first.fADCMaxBack2, second.fADCMaxBack2);

swap(first.fStripFront1, second.fStripFront1);
swap(first.fStripBack1, second.fStripBack1);
swap(first.fStripFront2, second.fStripFront2);
swap(first.fStripBack2, second.fStripBack2);

swap(first.fMultiplicityFront1, second.fMultiplicityFront1);
swap(first.fMultiplicityBack1, second.fMultiplicityBack1);
swap(first.fMultiplicityFront2, second.fMultiplicityFront2);
swap(first.fMultiplicityBack2, second.fMultiplicityBack2);
}

void Clear(Option_t *opt = nullptr) override;

void SetEFront1(Int_t idx, Double_t value) { fEFront1[idx] = value; }
void SetEBack1(Int_t idx, Double_t value) { fEBack1[idx] = value; }
void SetEFront2(Int_t idx, Double_t value) { fEFront2[idx] = value; }
void SetEBack2(Int_t idx, Double_t value) { fEBack2[idx] = value; }

void SetADCMaxFront1(Int_t idx, Double_t value) { fADCMaxFront1[idx] = value; }
void SetADCMaxBack1(Int_t idx, Double_t value) { fADCMaxBack1[idx] = value; }
void SetADCMaxFront2(Int_t idx, Double_t value) { fADCMaxFront2[idx] = value; }
void SetADCMaxBack2(Int_t idx, Double_t value) { fADCMaxBack2[idx] = value; }

void SetStripFront1(Int_t idx, Int_t value) { fStripFront1[idx] = value; }
void SetStripBack1(Int_t idx, Int_t value) { fStripBack1[idx] = value; }
void SetStripFront2(Int_t idx, Int_t value) { fStripFront2[idx] = value; }
void SetStripBack2(Int_t idx, Int_t value) { fStripBack2[idx] = value; }

void SetMultiplicityFront1(Int_t value) { fMultiplicityFront1 = value; }
void SetMultiplicityBack1(Int_t value) { fMultiplicityBack1 = value; }
void SetMultiplicityFront2(Int_t value) { fMultiplicityFront2 = value; }
void SetMultiplicityBack2(Int_t value) { fMultiplicityBack2 = value; }

Double_t GetEFront1(Int_t idx) { return fEFront1[idx]; }
Double_t GetEBack1(Int_t idx) { return fEBack1[idx]; }
Double_t GetEFront2(Int_t idx) { return fEFront2[idx]; }
Double_t GetEBack2(Int_t idx) { return fEBack2[idx]; }

Double_t GetADCMaxFront1(Int_t idx) { return fADCMaxFront1[idx]; }
Double_t GetADCMaxBack1(Int_t idx) { return fADCMaxBack1[idx]; }
Double_t GetADCMaxFront2(Int_t idx) { return fADCMaxFront2[idx]; }
Double_t GetADCMaxBack2(Int_t idx) { return fADCMaxBack2[idx]; }

Int_t GetStripFront1(Int_t idx) { return fStripFront1[idx]; }
Int_t GetStripBack1(Int_t idx) { return fStripBack1[idx]; }
Int_t GetStripFront2(Int_t idx) { return fStripFront2[idx]; }
Int_t GetStripBack2(Int_t idx) { return fStripBack2[idx]; }

Int_t GetMultiplicityFront1() { return fMultiplicityFront1; }
Int_t GetMultiplicityBack1() { return fMultiplicityBack1; }
Int_t GetMultiplicityFront2() { return fMultiplicityFront2; }
Int_t GetMultiplicityBack2() { return fMultiplicityBack2; }

ClassDefOverride(AtSiEvent, 1);
};

#endif
1 change: 1 addition & 0 deletions AtEventDisplay/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ${CMAKE_SOURCE_DIR}/AtEventDisplay/Deprecated
${CMAKE_SOURCE_DIR}/AtEventDisplay/AtTabs
${CMAKE_SOURCE_DIR}/AtEventDisplay/AtSidebar
${CMAKE_SOURCE_DIR}/AtEventDisplay/AtSidebar/PSA
${CMAKE_SOURCE_DIR}/AtData
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Why was this needed? Was there any warning when compiling regarding this? Just curious.

)

set(SRCS
Expand Down
2 changes: 1 addition & 1 deletion AtMap/AtMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class AtMap : public TNamed {

Bool_t ParseXMLMap(Char_t const *xmlfile);
void ParseMapList(TXMLNode *node);
void ParseAtTPCMap(TXMLNode *node);
virtual void ParseAtTPCMap(TXMLNode *node);
Bool_t DumpAtTPCMap();
AtPadReference GetPadRef(int padNum) const;
bool AddAuxPad(const AtPadReference &ref, std::string auxName);
Expand Down
1 change: 1 addition & 0 deletions AtMap/AtMapLinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#pragma link C++ class AtMap + ;
#pragma link C++ class AtGadgetIIMap + ;
#pragma link C++ class AtTpcMap + ;
#pragma link C++ class AtSiMap + ;
#pragma link C++ class AtTpcProtoMap + ;
#pragma link C++ class AtSpecMATMap + ;

Expand Down
Loading